Monday, August 2, 2010

Syntax of Shrinking SQL Server database mdf and log file

The below code snippet will help you to shrink the database. Run the code snippet through your SQL Server query analyser.
















backup log <database_name> with truncate_only 
use <database_name> 
dbcc SHRINKFILE (<database_name_Log>,2) 
dbcc ShrinkDatabase (<database_name>, 2)

No comments:

Post a Comment

Write your Comment: