How to Shrink SQL Server database log files?
How to Shrink SQL Server database log files?
Database Logs should be truncated whenever you perform a full backup of the database. You can also manually truncate them as follows.
Code
DECLARE @strDatabaseName nvarchar(255)
SET @strDatabaseName = 'YourDatabaseName'
BACKUP LOG @strDatabaseName WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE (@strDatabaseName, 0)--Parameters are Database Name & Target %
It was tested in SQL Server 2005 & it's working. It was also tested in SQL 2008 & it's working too.