| Posted by: herbet - 28 February 2023 14:25:43 |
|---|
| I am trying to repair a DB in a suspect state after exporting a VM server. I have backups from the other day but I would rather use the live one. It is not a production system. What is this error on DBCC checker running? Msg 596, Level 21, State 1, Line 0 Cannot continue the execution because the session is in the kill state. Msg 0, Level 20, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. |
| Posted by: herbet - 28 February 2023 16:54:27 |
|---|
| I had to put the DB in single user mode: ALTER DATABASE [DB Name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO run the checker with: DBCC CHECKDB (B[DB Name] REPAIR_ALLOW_DATA_LOSS) GO Then run the checker again: DBCC CHECKDB GO Then put it back in multi user mode: ALTER DATABASE [DB Name] SET MULTI_USER GO After that it seemed to be OK |
| Posted by: herbet - 28 February 2023 16:55:53 |
|---|
| Just as a sidenote - this was from running Disk2VHD on an SQL server with transaction shipping installed which is what caused the issue. I also had to restore the master and msdb DBs to get it working and restore file permissions to the DB files afterwards. |