Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy SQL database and clear data tables

Status
Not open for further replies.

denaliak

MIS
May 26, 2004
5
US
I need to make a copy of a database and delete all of the records from the user defined tables. I want to keep only the table definitions and stored procedures. What is the best way to do this. I am quite new to SQL. We are using SQL 7. Thanks
 
Do a backup and then restore the backup to a new database name. then you can use sp_MSForEachTable to trucnate all the tables.

You can also script the database in Enterprise Manager and use that script to create the tables, views, and procs, etc.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top