SQL SERVER - Shrinking Truncate Log File - Log Full
Sometime, it looks impossible to shrink the Trucated Log file. Following code always shrinks the Trucated Log File to minimum size possible.
Code:
USE DatabaseName
GO
DBCC SHRINKFILE(
BACKUP LOG
DBCC SHRINKFILE(
Here 1 is the file ID. To get the fileID you can run
Code:
SELECT file_id, name FROM sys.database_files
inside that DB or
Code:
sp_helpfile
also will do..
WITH TRUNCATE_ONLY option will be removed in a future version of SQL Server. Avoid using it in new development work, and plan to modify applications that currently use it.
Reference : http://blog.sqlauthority.com/2006/12/30/sql-server-shrinking-truncate-log-file-log-full/