Tuesday, May 5, 2009

Shrinking Truncate Log File - Log Full

Sometime, it looks impossible to shrink the Truncated Log file. Following code always shrinks the Truncated Log File to minimum size possible.

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

No comments:

Data Governance Learning Plan

Seven courses to build the knowledge of Data Governance Program ( planning & establishment ) by Kelle O'Neal with 100 MCQs Exam 1....