'Suspect' SQL Server database solution

'Suspect' SQL Server database solution

My database is marked suspect. What can I do?

    Requires Free Membership to View

    By submitting your registration information to SearchSQLServer.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSQLServer.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

The first step is to relax. Panic will get you nowhere, and SQL Server database problems like this can be stressful! So take a few deep breaths and remember that everything will be okay.

Next, read Tibor Karaszi's "Recommended actions for corrupt or suspect databases."

If you get to step six and still cannot get yourdatabase back up and running, it's time to restore from your last good backup. But you still might have a chance to retrieve any changed data that's in the database. SQL Server 2005 introduces a new database state, called EMERGENCY. This state puts the database into read-only, single-user mode, with access allowed by members of the sysadmin role only. This will make your database accessible and let you get in to pull out any data before doing a full restore.

To put a database into EMERGENCY state, use the following T-SQL, substituting the name of your database for 'YourDatabase':

ALTER DATABASE YourDatabase SET EMERGENCY;

This was first published in January 2006