Repair MS SQL Corrupted or Suspected Database

Submitted by Divya on
Execute the below query by replacing the 'test' with the database name. EXEC sp_resetstatus 'test' ALTER DATABASE test SET EMERGENCY DBCC CheckDB ('test') ALTER DATABASE test SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB ('test', REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE test SET MULTI_USER