Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Repair Database

Author  Topic 

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2007-09-22 : 16:01:55
Dear Gurus,

i am trying dbcc checkdb ('dbName','repair_allow_data_loss#39;)
to repair my databases as retrieved from suspect mode but this query is not being executed and saying database to be in single user mode as i have also executed query to take database in single user mode pls do help me

Thanks
Krishnakumar

Zoroaster
Aged Yak Warrior

702 Posts

Posted - 2007-09-22 : 18:30:21
Do you not have a backup you can restore from instead of doing the repair?
You need to do it like this:

Use <database_name>
GO
ALTER DATABASE <database_name> SET SINGLE_USER
GO
DBCC CHECKDB('database_name', repair_allow_data_loss#39)
GO
ALTER <database-name> SET MULTI_USER



Future guru in the making.
Go to Top of Page
   

- Advertisement -