TABLE OF CONTENTS
Reducing SQL Server Log File Size
Overview
Backing up your database protects your data and allows you to restore to a previous state if needed. In the context of ManagementStudio, regular database backups help ensure data integrity and support recovery options.
SQL Server transaction logs can grow significantly, especially when a database is set to Full Recovery Mode without regular log backups. If old log records are not removed, transaction logs may eventually consume all available disk space. Regular maintenance, including backups and log management, is essential to controlling log file size.
The following sections outline the steps to reduce the size of a SQL Server log file for the ManagementStudio database.
Steps to Reduce Log File Size
To reduce the transaction log file size on disk:
- Perform a full database backup.
- Perform a transaction log backup.
- Perform a shrink operation on the transaction log file.

Here are our initial file sizes on the disk.
1. Launch the Backup Wizard
- Connect to the SQL Server instance using SQL Server Management Studio (SSMS).
- In Object Explorer, expand the server tree.
- Expand Databases, right-click
ManagementStudio. - Navigate to Tasks → Back Up….

2. Perform a Full Backup
- In the backup wizard, set the Backup Type to
Full. - Choose a destination file for the backup. For demonstration, you may save it in the same folder as the database files.
- Complete the backup process.


Files after Full Backup.
3. Perform a Transaction Log Backup
- Launch the backup wizard again (see previous steps).
- Set the Backup Type to
Transaction Log. - Select the same backup destination file as previously used (the new backup will be appended by default).

- On the Media Options page, ensure that
Truncate the transaction logis selected under Transaction Log options. - Complete the log backup.


Files after Transaction Log Backup up.
4. Shrink the Transaction Log File
After performing the log backup, space in the transaction log is marked as available for reuse. If you need to physically reduce the log file size:
- Right-click the database in Object Explorer.
- Select Tasks → Shrink → Files….

- In the Shrink File dialog:
- Set File Type to
Log. - Review available free space (e.g.,
1608.70 MB free of 1672 MBtotal). - Select
Reorganize pages before releasing unused space. - Set the target file size, considering a balance between disk space and performance. Setting to zero forces SQL Server to resize based on internal needs.
- Click OK to shrink the file.
- Set File Type to

Files after Shrink operation:
Troubleshooting Shrink Operation
- If the log file does not shrink as expected, it may be due to active transactions or virtual log files with untruncated data.
- To forcibly shrink:
- Take the database offline and disconnect all active connections.
- Rerun the shrink operation, specifying the desired target size (e.g.,
200 MB). - With no active transactions, the shrink process should complete and the file will be resized accordingly.

Files after successful shrink operation.
Further Support
For additional assistance, visit the ManagementStudio Service Desk to search the knowledge base or create a new support ticket.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article