SQL Server error on update command - “A severe error occurred on the current command”

后端 未结 10 1943
一生所求
一生所求 2020-11-28 11:13

Running the following query in SQL Server Management Studio gives the error below.

update table_name set is_active = 0 where id  = 3
10条回答
  •  臣服心动
    2020-11-28 11:47

    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
    

提交回复
热议问题