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

Delete tables and shrink database 1

Status
Not open for further replies.

Jaminj

Technical User
Feb 19, 2005
54
US
Hello. We have a database that is 100gb in size. The validity of the data is now in question due to a server crash. I want to remove all data in the tables and reimport only the current year. Here are my questions:

1. How can I remove all data from tables? I would want the table structure to stay intact.

2. Once all data is removed how can I shrink the physical size of the database?

Thanks.
 
1. Refer to the BOL and look up TRUNCATE TABLE.

2. Refer to the BOL and look up DBCC SHRINKDATABASE and DBCC SHRINKFILE.

-SQLBill

Posting advice: FAQ481-4875
 
Thanks SQLBill. This gave me the information that I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top