Most users always suggest to detach and re-attach DB to remove the log file when dealing with large Transaction log file. There is one proper way to truncate the transaction log file to certain size. Here are the sample steps to truncate SQL Log file:

Truncate the log by changing the database recovery model to SIMPLE

ALTER DATABASE []
SET RECOVERY SIMPLE;
GO

Shrink the truncated log file to 5 MB

DBCC SHRINKFILE ([_Log], 5);
GO

Reset the database recovery model.

ALTER DATABASE []
SET RECOVERY FULL;
GO

Advertisements