Shrink MSSQL Database Transaction Logs
Have you ever encounter problem when managing MSSQL databases, the transactions logs is eating up your hard disk if you not initially configured to be limit in growth value. So, when you see this kind of problem, you actually can shrink the transaction log, and then change the limit of growth value using MSSQL Management Studio.
1. Open MSSQL Management Studio
2. Open the SQL command windows and put following lines
USE <DatabaseName>
GO
DBCC SHRINKFILE(<TransactionLogName>, 1)
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<TransactionLogName>, 1)
GO
Replace the <DatabaseName> and <TransactionLogName> with respective value and execute the SQL. Now your transaction logs will be shrinked and you will save a lot of disk space. Do not forget to do the prevention action afterwards!
Related Posts
- Install MySQL Cluster in Debian
- Customize and Disable PHPmyAdmin ‘Export’ Menu
- High Availability: cPanel with MySQL Cluster, Keepalived and HAProxy
- Monitor MySQL Galera Cluster from Split-Brain
- CentOS 6: Install MySQL Cluster – The Simple Way
- High Availability: Configure Piranha for HTTP, HTTPS and MySQL
- CentOS: Integrate ClusterControl into Existing MySQL Galera Cluster
- Easiest Way to Install A Complete MySQL Galera Cluster
- MySQL – Recover Data Using mysqlbinlog
- CentOS: Install Percona XtraDB Cluster
If you enjoyed this article, please consider sharing it!
2 Responses to Shrink MSSQL Database Transaction Logs
Leave a Reply Cancel reply
Sci/Tech – Google News- iOS 7 likely to be flat ... and black and white? - NBCNews.com 24 May 2013
- A Best-Selling Phone? It's Not Just a Good Phone - New York Times (blog) 24 May 2013
- Microsoft refutes reports about Xbox One used game sales - CNET 24 May 2013
- Why Google's Display Ad Business Drew FTC Antitrust Probe - Forbes 24 May 2013
- Russia's leading social network banned by 'mistake' - Toronto Sun 24 May 2013


When you reference “Do not forget to do the prevention action afterwards!” – are you referring to setting the growth limit on the transaction log?
Yeap. That is what I mean