Repair a SQL database which is in “suspected” state

Step 1.  Connect to the Microsoft SQL Server Management Studio
Step 2.  Click the New Query button
Step 3,  Execute following SQL query by replacing DatabaseName with the correct DB name.

    EXEC sp_resetstatus DatabaseName;
    ALTER DATABASE DatabaseName SET EMERGENCY
    DBCC checkdb(DatabaseName)
    ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    DBCC CheckDB (DatabaseName, REPAIR_ALLOW_DATA_LOSS)
    ALTER DATABASE DatabaseName SET MULTI_USER

Step 4.  Click Execute

———————–

Following are the main cause of Database in suspected state:
Database may be corrupted
Lack of disk space on the server to recover the database during startup.
Insufficient memory on the server
Database files are being used by operating system, third party backup software etc.
Unexpected SQL Server Shutdown, power failure or a hardware failure.

Leave a Reply

Your email address will not be published. Required fields are marked *