Thursday, May 17, 2012

Recover or Restore SQLServer Database from Suspect Mode

     Is your SQL Server database is marked with "Suspece", then your database is in suspect mode.

     When your project's Database is in Suspect mode, then you are not able to do any transactions from the database.  This will leads your brain to a big tension mode.  Don't worry, Here are the steps to restore your SQL Server database from Suspect Mode back to Operational Mode.

Run the below script by replacing the text "your database name" to Your database name which you need to restore.


There will not be any data loss.  I have tried two times on my local database and also in the live database.



EXEC sp_resetstatus ' your database name ';
ALTER DATABASE  your database name  SET EMERGENCY
DBCC checkdb(' your database name ')
ALTER DATABASE  your database name  SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (' your database name ', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE  your database name  SET MULTI_USER



HAPPY CODING....