Showing posts with label SQL Suspect mde. Show all posts
Showing posts with label SQL Suspect mde. Show all posts

Friday, December 10, 2010

How to repair a SQL Server 2005/ 2008 Suspect database

Some times after Hardware or Power failure, when you open the SQL Management studio; you find that some of your databases are not accessible, and they are marked as “Suspect”
To fix this you can run the following query (replace “MyDataBaseName” with the database name):
ALTER DATABASE MyDataBaseName SET EMERGENCY
DBCC checkdb ('MyDataBaseName')
ALTER DATABASE MyDataBaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('MyDataBaseName', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE MyDataBaseName SET MULTI_USER

Source:
http://gargmanoj.wordpress.com/2008/07/17/how-to-repair-a-sql-server-2005-suspect-database/