Last active
December 16, 2024 14:30
-
-
Save haroldcris/966841d514c2596a6261ae78d4d99401 to your computer and use it in GitHub Desktop.
MS Sql Recover from CheckDb Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> To Check Run | |
DBCC CHECKDB ([DATABASENAME] ) WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY | |
> To Fix | |
ALTER DATABASE promis | |
SET SINGLE_USER WITH NO_WAIT | |
--WITH ROLLBACK IMMEDIATE; | |
GO | |
DBCC CHECKDB (promis, REPAIR_REBUILD ); /**OPTIONS: repair_rebuild OR REPAIR_ALLOW_DATA_LOSS **/ | |
GO | |
ALTER DATABASE promis | |
SET MULTI_USER; | |
>>>>> | |
Get Error Page Number and Run | |
DBCC TRACEON (3604) | |
DBCC PAGE ('DatabaseName', 1, [PageNumber] , 3) | |
> Copy Result to Note Pad. | |
> Look for Invalid world to find the AutoId | |
Resources: | |
https://sqlserverpowershell.com/2014/03/10/fixing-dbcc-check-error-2570/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To Fix:
You can use DBCC CHECKDB (promis, repair_rebuild)