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/

2 comments:

  1. sql repair has all necessary probabilities for working out troubles related to bad mdf files. It can repair .mdf files after various issues: power failures, viruses, hacker attacks. The tool view restored mdf files for you.

    ReplyDelete
  2. Restoring data from corrupt SQL Database is not an easy task. A third party SQL database recovery software may help the users to get upto 100 % data in such type situations. One of the best and globally used application can be downloaded from here:

    http://www.recoverydeletedfiles.com/sql-database-recovery-software.html

    ReplyDelete