Shrink SQL Server Log Files

When you’ve got large log files during development it can be helpful to quickly shrink them to save some disk space.

-- find info about your database, namely what the log file is called
SELECT * FROM sys.database_files
 
-- perform the shrink
USE kd01;
ALTER DATABASE kd01 SET RECOVERY SIMPLE
DBCC SHRINKFILE (kd01_log, 1)
GO

admin

Chris Tran is a Software Business Manager from Brisbane, Australia. When he's not enjoying time with his family, he works with some very talented people at KoBold Group Pty Ltd.

More Posts

Follow Me:
TwitterFacebookLinkedInGoogle PlusFlickrYouTube

Comments