Tuesday, July 8, 2008

To SHRINK the log file in SQL

Your sql log file size are huge and you are sort of harddisk memory...

Just execute this command in sql browser, with replacing your DB name to "DBName" in below query:

DBCC SHRINKFILE(DBName_log, 5)
BACKUP LOG DBName WITH TRUNCATE_ONLY DBCC SHRINKFILE(DBName_log, 5)

Here 5 is the reduced memory size, your log file will reduced to 5MB.

No comments: