Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to compact a SQL2000/2005 MDF file?

Tags:

sql-server

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)?

like image 555
Teller Avatar asked Oct 02 '08 15:10

Teller


2 Answers

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

like image 20
Cade Roux Avatar answered Nov 15 '22 09:11

Cade Roux


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

like image 102
user21576 Avatar answered Nov 15 '22 09:11

user21576