Category Archives: SQL Server

How to recover Suspected Database

MSSQL server database can be suspected due to following reasons.

  • The database is corrupted
  • There is no enough storage in your system in order Sql Server to fix your database.
  • Database files are being locked by other programs or operating system
  • unexpected shutdown of sql server or system

Here is a simple way to fix your database. however you must be able to log in to Sql Server Management studio first.

Replace Your_Suspected_Database with your actual database name first. then run this query afainst master database.
its recommended to run one line at a time. in checkdb steps you may get error results as well. how ever you can continue to next step.

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