Dropping a database

  • When I am trying to drop a database wit the following command

    DROP DATABASE new_db

    I am getting the following error.

    Cannot drop the database new_db' because it is being used for replication.

    Actually I am trying to restore an existing Database as a new database(new_db).

    so now the new database is created and it has got some problem with restoration. So when I try to delete the new Database its giving the above error. So how can I drop this new_Db database.

  • If replication cannot be removed try taking the database offline and then try dropping it.

  • Server: Msg 947, Level 16, State 1, Line 1

    Error while closing database 'new_db' cleanly.

    Server: Msg 5069, Level 16, State 1, Line 1

    ALTER DATABASE statement failed.

    sp_dboption command failed.

     

    This is the message I got when I tried to make the database offline.

     

    The database status is showing as loading. And I am unable to open the database and I can't detach the database.

    I was trying to restore this database from a database which has replication on it and the restoration was failed and I didn;t save the error when it was failed.

    so how can I drop this database.

    Thanks.

  • Database 'new_db' cannot be opened. It is in the middle of a restore.

     

    This is the error I am getting when I try to open or query the DB.

     

    Thanks.

  • My gut feeling is to re-start SQL but that seems a bit drastic.

    Anyone with a less intrusive suggestion?

    - Just saw your post above - let the restore complete if you can.

  • I don't know how you did the restore, but I'm guessing you included the WITH NORECOVERY option or put it in standby. Try this...

    RESTORE DATABASE dbname

    WITH RECOVERY

    -SQLBill

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply