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

  • Hello, you need to run the following:

    sp_configure "allow updates", 1

    go

    Reconfigure with override

    go

    After you execute the failing command:

    sp_configure "allow updates", 0

    go

    Reconfigure with override

    go

    Hope this helps.

    Todd

  • Taking the database offline works like a charm. Thanks raja

  • You must use the next:

    use master

    GO

    sp_configure 'allow updates', 1

    GO

    RECONFIGURE WITH OVERRIDE

    GO

    to allow updates over system databases

    When you finish the operation, yo must run the next:

    use master

    GO

    sp_configure 'allow updates', 0

    GO

    RECONFIGURE WITH OVERRIDE

    GO

  • Go back and drop the data / log files since dropping an offline database doesn't delete these files.

  • Taking it offline worked. Thanks for the post!

  • Hello all

    I just find another simplest way to workaround it.

    Expand the server in SSMS;

    Right-click in Replication folder;

    Click "Disable Publishing and Distribution"...

    This action should delete all files, jobs and distribution database.

    It worked for me.

    Hope this helps

    Regards

  • Worked like a charm with "Offline" mode!

    I had a interesting situation: my database was in Warm Standby mode, and I had a .tuf file deleted. The releiving thing was that I didn't needed this database anymore, but I couldn't delete it because of remained publications from primary log shipped database. The publication couldn't be deleted, of course, because the DB was read only. The DB could not be recovered because of missing tuf file.

    The only solution that worked was putting the DB to offline mode, and then deleting manually the data and log files. Also the publication disappeared.

    Thanks!

Viewing 8 posts - 16 through 22 (of 22 total)

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