Wednesday, September 30, 2009

Shrink Log File

--To shrink the log file

USE DatabaseName
Go
DBCC SHRINKFILE(, 1)
BACKUP LOG WITH TRUNCATE_ONLY
DBCC SHRINKFILE(, 1)GO
Go

--truncates the log by discarding all but the active log
--suggested to take a backup of the database immediatelty after this

1 comment: