This is one of the situations when we should truncate the log file. Here's a code snippet which I have used with SQL Server 2005 and which works.
Say you have a database called ABCD and its files are ABCD.mdf and ABCD_log.ldf
Now log into sql server 2005, open a new query window in ABCD database, paste and run following commands
DBCC SHRINKFILE('ABCD_log', 1)Make sure to put in the name according to your database.
BACKUP LOG ABCD WITH TRUNCATE_ONLY
DBCC SHRINKFILE('ABCD_log', 1)
GO
Also note the number '1' means log will be truncated to 1 MB.
No comments:
Post a Comment