Tuesday 3 June 2014

How To Shrink SQL Server Database Transaction Log


I find this technique to be fairly simple enough but powerful. This must be run in SSMS.

backup log [dbname] with truncate_only;
go

DBCC SHRINKDATABASE ([dbname], 10, TRUNCATEONLY);
go

Don't bother doing this if you have no important reason to do so. I just needed to get a copy of our server's data into my  SQL Server Express which has a 4 Gig per database license restriction.

Have fun! :)

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...