Friday, March 9, 2012

Drop Database

Hi all,

I try to restore a DB on MS SQL 2000 but something was wrog because restored DB compare on tree view of SQL Enterprise Manager commented with "(Loading/Suspect)".

I can't access to DB and I cant delete it. I obtain this : "Error 3724: Cannot drop the database 'XXXX' bacause it is being used for replication.

How can I delete or solve this problem?

Thank's a lot

bye

HID

Hi hidme...

To get the database out of the loading state, try the following statement:

restore database <dbname> with recovery

Assuming that brings your database up into an accessible state, then try dropping any publications/subscriptions/etc. that are included on the database, or try running the following as a last-ditch resort (only if you plan on destroying the database anyhow hopefully):

exec sp_removedbreplication @.dbname = '<dbname>'

Then you should be able to drop the database, repost if you continue to have problems,

HTH,

|||

Well,

thank's for your rapid suggest and sorry for may long break.

So the problem persist because I can't access to DB for restore..., what do you think if I try to shutdown DBMRS and I delete file_data.mdf ? Do you think a link on tree of SQL Manager go away?

Thanks

hid

|||

Hi hid...when you say you can't access the DB for restore, are you saying that you are trying to switch to that database to perform the restore? If so, you should be able to run the restore statement above from the master database against the database you are having trouble with.

If that's not what you are saying, could you provide a little clarification for me?

Also, don't delete the mdf/ldf files, the database in the tree will not disappear, it will simply show up as corrupt...

|||

I think he is trying to restore using the GUI by right clicking on the database.

hidme, don't use the GUI interface. Write the code into a query window and execute it against the master database.

No comments:

Post a Comment