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