When your SQL Server Database goes to corrupt then you use Manual Methods for Corrupt SQL Server Database Repair. You can do it this following steps which are given below.
Steps to Repair Corrupted MDF File With DBCC CHECKDBFirst 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.
When manual methods fail to repair SQL Server Database then use SQL Database Recovery Software
Read More: https://community.spiceworks.com/how_to/157233-how-to-fix-recovery-pending-state-in-sql-server-database
Hi, Nice writeup! One can also read this to repair corrupted SQL server database easily. https://dzone.com/articles/how-to-repair-mdf-file-in-sql-server-database