Truncate/Shirnk ldf File in Sql Server2005

The following Sql Statements will clear .ldf file into normal size.

Declare @logfile_id int
Backup Log <> with No_Log
Select @logfile_id = max(fileid) from dbo.sysfiles where name like '%log%'
DBCC Shrinkfile (@logfile_id, truncateonly)

My 10GB Database ldf came back to 2 MB. :-)

Comments

Popular posts from this blog

Windows Azure Package Build Error: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Resource ID : 1. The request limit for the database is 180 and has been reached.

How to get Client's Location using IPAddress