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)
 Unable to Delete a Sql Database Gone in suspect

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-21 : 10:32:15
Umesh writes "Sir,
I have a database named as 'CmsRepl' which is gone in a suspect mode. We wanted to delete the database, but we are unable to do so.

This Database was used for replication also.
We try to workaround this problem.
We try to Detach the database using 'sp_detachdb', but it says that your database is used in replication.So what we did was remove all the related publication entries related with that database from the distibution table.But even then the same error , it is used in replication.

Kindly suugest any way by which the database whch has gone in suspect mode, can be deletd from the sql server."

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-08-21 : 10:55:26
had this lying around for a while now which may help ? Might help you drop it.


//If your have a database that is marked suspect but there is no real
//problem this script will change the status flag and allow you to use
//the database. If you have more than one suspect database, comment
//the shutdown database section until you have changed the status on
//all suspect databases.

use master
go
sp_configure "allow updates", 1
reconfigure with override
go
update sysdatabases
set status = status - 256
where name = "database name"
and status & 256 = 256
go
sp_configure "allow updates", 0
reconfigure
go
checkpoint
go
shutdown
go

Paul
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-21 : 12:41:08
You can also run sp_removedbreplication [ @dbname = ] 'dbname' once the database is out of suspect status to remove all the replication structures.



HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -