How To Repair A Suspect Database In MS SQL
You have a database in MS SQL that is tagged as (suspect) and you are unable to connect to the database.
- The database could have become corrupted.
- There is not enough space available for the SQL Server to recover the database during startup.
- The database cannot be opened due to inaccessible files or insufficient memory or disk space.
- The database files are being held by operating system, third party backup software etc.
- There was an unexpected SQL Server Shutdown, power failure or a hardware failure.
These steps require you to have Microsoft SQL Server Management Studio installed on your computer. If you do not have this installed please install Microsoft SQL server Management Studio to connect database server.
Open Microsoft SQL Server Management Studio and connect to your database
- Click the New Query button
- Paste the following SQL script into your New Query page replacing [YourDatabase] with the name of your database.
DBCC CheckDB ([YourDatabase], REPAIR_ALLOW_DATA_LOSS)
- Click Execute
Your database should no longer be tagged as (suspect) and you should be able to access it.