Running the following query in SQL Server Management Studio gives the error below.
update table_name set is_active = 0 where id = 3
One other possible solution we just found after having this issue across multiple databases/tables on the same server.
Is the max connections open to the sql server. We had an app that wasn't closing it's SQL connection and was leaving them open so we were running around 28K-31K connections (SQL Sever has a max out at 32K ish), and we noticed that once we killed a few thousand sleeping connections it took care of the error listed on this question.
The fix was to update the apps to make sure they closed their connections instead of leaving them open.
I was having the error in Hangfire where I did not have access to the internal workings of the library or was I able to trace what the primary cause was.
Building on @Remus Rusanu answer, I was able to have this fixed with the following script.
--first set the database to single user mode
ALTER DATABASE TransXSmartClientJob
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
-- Then try to repair
DBCC CHECKDB(TransXSmartClientJob, REPAIR_REBUILD)
-- when done, set the database back to multiple user mode
ALTER DATABASE TransXSmartClientJob
SET MULTI_USER;
GO
This error is exactly what it means: Something bad happened, that would not normally happen.
In my most recent case, the REAL error was:
Msg 9002, Level 17, State 2, Procedure MyProcedure, Line 2 [Batch Start Line 3]
The transaction log for database 'MyDb' is full due to 'LOG_BACKUP'.
Here is my checklist of things to try, perhaps in this exact order:
This seems to happen when there's a generic problem with your data source that it isn't handling.
In my case I had inserted a bunch of data, the indexes had become corrupt on the table, they needed rebuilding. I found a script to rebuild them all, seemed to fix it. To find the error I ran the same query on the database - one that had worked 100+ times previously.