In MS SQL Server system, the CHCEKDB utility is used to check the consistency of the databases. It utility has a 3-stage process that involves performing allocation check in the first stage, then consistency checks on the system tables. If both these stages are safely bypassed, then the complete database is checked for consistency in the final stage. At times, due to some errors the utility is unable to complete and exits abruptly. In such cases, you should try to resolve the errors using appropriate SQL repair methods. If none of the methods succeed, then you should take the services of a third-party SQL server recovery software to repair SQL database.
Let us consider a practical situation in which you are running CHECKDB on a database in MS SQL Server 2000 database. The process exits in the second stage and the following error message is displayed:
Database ‘DBNAME’ consistancy errors in sysobjects, sysindexes, syscolumns, or systypes prevent further CHECKNAME processing.
This problem has occurred because in the Stage 2 of CHECKDB, some unrepairable errors were found. Due to this, the Stage 3 could not continue and the utility ended abruptly. It is possible that the metadata for all the objects in the database is corrupt.
To overcome this problem, you would need to repair MDF file. To do this, you should perform the following SQL repair methods:
Repair hardware related errors: As is seen in most of such cases, a lot of database errors occur due to corruption in the hardware components. To address such issues, you can try and implement the following measures:
Checking the Error logs and inferring whether the error has occurred because of hardware corruption.
Running hardware diagnostics and fixing the errors, which appear as a result of it.
If the problem is quite persistent, then check if write-caching is enabled in the disks. If yes, then contact your hardware vendor to replace it.
Finally, if nothing works out then reinstall the operating system after formatting the disks.
Restore from database: If the problem is not hardware-related, then check and analyze the backup. If it is clean and updated, then restore the database with the backup.
Run DBCC CHECKDB: If the previous method does not provide solution, then use DBCC CHECKDB with the suggested repair clause.
In case the problem persists, then the database is severely damaged, which could be repaired using a third-party .MDF file repair software. Use of highly effective repair algorithms in a highly interactive user interface are the best features of these MDF repair tools.
The best MS SQL repair software is Stellar Phoenix SQL Data Recovery, which repairs SQL databases created in MS SQL Server 2008, 2005, 2000, and 7.0. Having the capability to repair MDF file and recovering objects including tables, NDF files, triggers, etc, this SQL repair tool is compatible with Windows 7, Server 2008, Vista, Server 2003, XP, and 2000.
My name is Mark Willium, I have done Ph.D in computer science and currently doing research on how to recover and repair corrupted sql database. You can have more information about about sql recovery by visiting my blog http://sql-server-recovery.blogspot.com/