3 replies
Hi,
In case there is a minor issue in the MDF file, then you can execute DBCC CHECKDB command. This inbuilt utility, which is free to use.
by sagarleo1
First of all, you need to run DBCC CHECKDB on the corrupt SQL database by executing the following query:
DBCC CHECKDB (Name_of _corrupt _database)
Note: You can also define some options like no_infomsgs and infomsgs with DBCC CHECKDB.
After that, you need to check the index ID.
Case 1: If index ID > 1, drop it and create it again.
Case 2: If index ID is either 0 or 1, then run DBCC CHECKDB again with the appropriate repair options like repair_rebuild, repair_fast, or repair_allow_data_loss.
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)
Now, to ensure zero corruption, execute DBCC CHECKDB and a message is displayed i.e. DBCC CHECKDB displays 0 allocation errors and 0 consistency errors in name_of_your_corrupt_database.
This discussion is closed to new replies.
Trending Software posts
Sort by Trending