Alexander Anikin's blog

My personal blog

Archive for the ‘Databases’ Category

SQL Server Database in Suspect Mode

leave a comment »

I had a strange issue on one of my old SQL Server 2005 Express.

My application database was marked as SUSPECT.

My great fault was no backups and I need solution without great data looses.

Big thanks to CodeProject.

SQL:

EXEC sp_resetstatus ‘yourDBname’;
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb(‘yourDBname’)
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (‘yourDBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER

Advertisements

Written by Alex Anikin

February 28, 2011 at 1:45 pm

Posted in Databases