Stop Transaction Logs from Growing on a SQL Server 2012 Lab Install

If your SQL Server 2012 database doesn't get backups, it's useful to truncate the log files to minimize disk usage. Here's how to do it.

John Savill

February 5, 2013

1 Min Read
Stop Transaction Logs from Growing on a SQL Server 2012 Lab Install

Q: I have a database in my lab environment that I don't back up. How can I stop the transaction logs from growing on my SQL Server 2012 install?

A: In a typical SQL Server database, the transaction logs keep growing until a backup is performed, which truncates the log files. It's logical not to delete transaction logs until a backup, because in the case of a database corruption or loss, the last backup could be restored and all the transaction logs replayed to get the database back to the current state with no loss (which is why the database and log files should always be on different disks).

In a lab environment where backups aren't performed and the data isn't critical, it might be preferable to simply automatically truncate the log files to keep disk space minimized.

To do this, use SQL Server Management Studio to set the recovery model of the database to Simple. Just right-click the database you want to set the recovery model for, and select Properties. Select the Options page and change the Recovery model to Simple (see screen shot below).

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like