The log file for database ‘XXX’ is full. Back up the transaction log for the database to free up some log space.

When I try to update some data on the database today, I have received the following error.
The log file for database ‘XXX’ is full. Back up the transaction log for the database to free up some log space.
It said the log file for the database is full, so I need to clear the log to free up some space.
Fortunatley, it is quite easy to do. What you need to do is as the following:
Solution:
1) Open up SQL Server Management Studio/ SQL Query Analyzer
2) Select the database which you want to to clear the transaction log.
3) the run the query below.
BACKUP LOG [DatabaseName] WITH TRUNCATE_ONLY
DBCC SHRINKFILE ([DatabaseLogName_Log],500)

Hope you find it useful.

Leave a Reply