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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty Database

Status
Not open for further replies.
Apr 4, 2003
25
GB
Hi,

I want to keep a database but empty it's contents. Basically so i have an empty Database ready to be re populated. Can someone give me the correct T-SQL for this please.

Thank you in advance
 
If there are just a few tables in the database, you can use this for each table:

Truncate Table YourTableName


If you have too many tables to truncate individually, I would suggest scripting the database and recreating a new database from the script. The script will generate an exact blank copy of your database.

Hope This Helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top