Nates Stuff

Perspectives on Computing :: Leave a Comment

How to Truncate Your Database Transaction Log

Sometimes those transaction logs get a little large and unwieldy!  For dev machines I almost never want the transaction log to ever be larger than 1GB.  I often find some transaction logs of 10GB and larger and there is little in the way of GUI tools to help you free up that wasted space.  Luckly there is a really good command for SQL Server 2005 & SQL Server 2008 that will allow you to truncate the existing transaction log.

DUMP TRAN [DATABASE_NAME] WITH TRUNCATE_ONLY

That's it!  You would think they would include a button or something in SQL Server Management Studio, but as I understand it this would be a bad thing to do in a production environment.

Hope this helps someone -- if so leave a comment!

Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: