smratisharma (5/31/2010)
To repair the database, run the following queries in Query AnalyzerEXEC 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
And It Repairs the Database. It Works for Me 🙂
If you had bothered to read the initial post completely, you would have noticed that the OP tried this and the emergency mode repair failed. Hence, this advice is completely useless in this case. It is also not the recommended first approach to dealing with corruption.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability