Thursday, August 02, 2007

How to truncate a log file in SQL Server 2005

An interesting error occurred on our test ColdFusion server this morning that is worth remembering.

"The transaction log for database '<database>' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases'

Now, looking at that field in sys.databases does nothing for you at all. However, I did find this helpful page on codeproject.com that helps you to truncate the log file in SQL Server 2005.

http://www.codeproject.com/useritems/truncate_log_SQL_server.asp

This is the page to go to - this tells you how to take your DB offline and detach it, then remove the log file.

No comments: