Database Logs should be truncated whenever you perform a full backup of the database. You can also manually truncate them as follows.
DECLARE @strDatabaseName nvarchar(255)
SET @strDatabaseName = 'YourDatabaseName'
BACKUP LOG @strDatabaseName WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE (@strDatabaseName, 0)
It was tested in SQL Server 2005 & it's working. It was also tested in SQL 2008 & it's working too.
For Your Information
Why won't my transaction log shrink?
Programmer | Dude | ||||||
About him & his blog? check out here
. Currently he's updating the site, he'll return soon there with more things*
In Codeproject, he posted a blogpost
& more than couple of Tip/Tricks
, hope he'll write more soon.
Favorite techs are MVC, WCF, Mobile, HTML5, CSS3, jQuery, etc.,
His hobbies are watching movies, CP, being alone, etc., But now he's working on something*