Search This Blog

August 03, 2012

How to Shrink SQL DATABASE

Change the Database_name to the database to be shrink.
Execute the Select statement and use the file_id in the DBCC SHRINKFILE COMMAND.


USE <>

SELECT File_id, name FROM Sys.DATABASE_Files; DBCC SHRINKFILE(<>, TRUNCATEONLY)