Shrink LDF files in MSSQL

If you have noticed a lack of disk space and used SpaceSniffer to see what was taking so much room on your Microsoft SQL server; you may be in for a surprise when your LDF file (log files) have grown to an almost unmanageable size.


There’s an easy fix that.

First open Microsoft SQL Server Management Studio.  Next, backup the transactional log. (Right Click your table, go to Tasks, Backups and Choose the backup type as Transaction Logs)


backup in progress

Next, we can flush the LDF file by doing a checkpoint Query.  Click on new query, type in Checkpoint and Execute the query.


After running the Checkpoint query, backup the log again.  Now Shrink the file by Right Clicking, Tasks, Shrink, File and specify Log as the file type.

Shrink the ldf

after shrink

About TCAT Shelbyville IT Department

The Tennessee College of Applied Technology - is one of 46 institutions in the Tennessee Board of Regents System, the seventh largest system of higher education in the nation. This system comprises six universities, fourteen community colleges, and twenty-six Applied Technology Colleges.
This entry was posted in Technology, Windows, Windows Server and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s