I’ll tell you how to work with DBCC CHECKDB inbuilt utility. Follow below steps:
1. Run DBCC CHECKDB command on the database i.e. corrupted.
DBCC CHECKDB (Name of corrupt database)
2. Check the index id. If id is greater than 1, then drop and recreate it. If It is 0 or 1, then run DBCC CHECKDB command with some repair options like repair_fast, repair_rebuild, repair_allow_data_loss.
Follow below command:
DBCC CHECK (name of corrupt database, repair_fast)
DBCC CHECK (name of corrupt database, repair_rebuild)
DBCC CHECK (name of corrupt database, repair_allow_data_loss)
3. Run DBCC CHECKDB again to check zero corruption and then a new message will receive as shown:
“DBCC CHECKDB found 0 allocation errors and 0 consistency errors in ‘name of your corrupt database”