tags:

views:

1086

answers:

3

I deleted millions of rows of old data from a production SQL database recently, and it didn't seem to shrink the size of the .MDF file much. We have a finite amount of disk space.

I am wondering if there is anything else I can do to "tighten" the file (like something analogous to Access' Compact and Repair function)?

+6  A: 

Use the Shrink File option in Sql Server Management Studio Right-click on Database > Tasks > Shrink > Database (or Files)

+4  A: 

DBCC SHRINKDATABASE etc. - read up on transaction logs and backups in the Books Online

Cade Roux
+2  A: 

If large log files are the problem, this may help:

backup log MY_DATABASE WITH TRUNCATE_ONLY;

Then right click on MY_DATABASE and choose All Tasks->Shrink Database as teller suggested.

JosephStyons