We ran into an issue where our log table got far larger far faster than was really anticipated and appear to have filled up most of our allocated database space. We don’t have the ability to increase the amount of available space, so we decided to clear out the log files. However, apparently we don’t have enough space to do this either (even after truncating the log files). Is there any way around this?
Here is the command we are running (I’ve changed the table and db names) and the error that is generated.
DELETE
FROM [db].[dbo].[logtable]
Msg 9002, Level 17, State 4, Line 2
The transaction log for database 'db' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
Msg 1101, Level 17, State 12, Line 2
Could not allocate a new page for database 'db' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
You should be able to use the truncate table instead.
http://msdn.microsoft.com/en-us/library/ms177570.aspx