Truncate log on MS Sql 2005

When the transaztion log is full, you can truncate it by using this query:

 

USE DatabaseName

GO

DBCC SHRINKFILE(<TransactionLogName>, 1)

BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY

DBCC SHRINKFILE(<TransactionLogName>, 1)

GO

 

<TransactionLogName> is the name of the t log without extension and path

 

_____________________________________

Stefano Mazgon

 

Commenti

Post popolari in questo blog

Errors in attaching mdf after ldf corruption or deletion

Acer Aspire ONE AOA150 won't boot, display black, only power led on

Remove hidden partitions from a disk