none
cannot delete Distribution database RRS feed

  • Question

  • I have been 'playing' setting up merge replication just so i can get a feel for what is going on, now I want to clean everything out and start afresh but I cannot remove the distributor I deleted the subscription and publication Ok.

    I get

    Could not drop the Distributor 'DELLDUO'. This Distributor has associated distribution databases.

    and when I try to delete the database directly using drop  get

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




    jnc
    Wednesday, April 8, 2009 2:43 PM

Answers

  • Hi,

        Run the following T-SQL on the database, and then try to delete. Delete should happen fine after this.  

    sp_replicationdboption  'MPCDistribution', 'merge publish', false

    Thanks
    Udaya
    • Proposed as answer by UdayaBG Wednesday, April 8, 2009 5:22 PM
    • Marked as answer by jnc Thursday, April 9, 2009 8:42 AM
    Wednesday, April 8, 2009 5:22 PM

All replies

  • Hi,

        Run the following T-SQL on the database, and then try to delete. Delete should happen fine after this.  

    sp_replicationdboption  'MPCDistribution', 'merge publish', false

    Thanks
    Udaya
    • Proposed as answer by UdayaBG Wednesday, April 8, 2009 5:22 PM
    • Marked as answer by jnc Thursday, April 9, 2009 8:42 AM
    Wednesday, April 8, 2009 5:22 PM
  • Thanks
    jnc
    Thursday, April 9, 2009 8:42 AM
  • I have been 'playing' setting up merge replication just so i can get a feel for what is going on, now I want to clean everything out and start afresh but I cannot remove the distributor I deleted the subscription and publication Ok.

    I get

    Could not drop the Distributor 'DELLDUO'. This Distributor has associated distribution databases.

    and when I try to delete the database directly using drop  get

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




    jnc

    First find out the sessionID currently in use and kill it

    SELECT spid FROM sys.sysprocesses WHERE dbid = db_id('distribution')

    and then try 

    exec sp_dropdistributor @no_checks = 1


    Friday, April 5, 2013 11:07 PM