How to repair suspected mssql database-
When you connect your MSSQL server you may notice some database(s) in ’suspected’ mode and it doesn’t let you do anything. This is happening because of database corruption, server not properly shut down, etc.. To repair the ’suspected’ database you may need to run the following query in your Query Analyzer(for SQL 2000) or Management Studio (for SQL 2005 and 2008)-
EXEC sp_resetstatus databasenamehere;
ALTER DATABASE databasenamehere SET EMERGENCY
DBCC checkdb(databasenamehere)
ALTER DATABASE databasenamehere SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (databasenamehere, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE databasenamehere SET MULTI_USER
Note: Before running the query please make sure you have taken the copy of data and transaction log files to another location.
Your database is repaired now
…
Recent Comments