Monday, March 21, 2011

sql shrink log files

found this useful to keep necessary usage of disk space with sql db installed

USE myDatabase
GO
DBCC SHRINKFILE(myDatabase_log, 1)
BACKUP LOG myDatabase WITH TRUNCATE_ONLY
DBCC SHRINKFILE(myDatabase_log, 1)

No comments: