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

  • phillip_latham

    SSC Journeyman

    Points: 89

    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

  • lyhe

    Valued Member

    Points: 59

    Taking the database offline works like a charm. Thanks raja

  • rafael.algora

    SSC Enthusiast

    Points: 103

    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

  • SA-1

    SSCrazy Eights

    Points: 8113

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

  • Fonseca

    SSC Veteran

    Points: 220

    Taking it offline worked. Thanks for the post!

  • Rodrigo Moraes-286573

    SSC Rookie

    Points: 46

    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

  • arbcoll

    Old Hand

    Points: 317

    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!

  • Nilesh-618477

    SSC-Addicted

    Points: 429

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

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