SQL Script to clear database tables.

Posted by pencilslate on Stack Overflow See other posts from Stack Overflow or by pencilslate
Published on 2010-03-24T20:46:27Z Indexed on 2010/03/24 21:03 UTC
Read the original article Hit count: 231

Filed under:
|

I have a need to take backup of a SQL Server Db with tons of data in it and import into another environment for updating and testing. Since, i am not interested in the data, i just want to recreate the schema on my other server. There is an option called 'Generate Script', but is throwing errors running them on the target server.

Curious, if anyone attempted to write a SQL script that would run through all the tables in the db and clear the rows, thereby i could just create the schema backup as .bak file and restore it into another server.

© Stack Overflow or respective owner

Related posts about tsql

Related posts about sql-server-2008