Stopping replication

  • hi,

    what is the best way to stop replication? Should I simply stop the distribution agent job & then disable it? Or is there a better way?

    Thanks in advance

  • Yes that is for me the best way in case you still want to use the publication. But be carefull with the time that SQL will maintain the publicatio nactive. Check the properties to know after how much time you will need to reinitialize the publication.

  • Many hhanks for your reply, racosta.

    I am trying to automate all of the failover and setting up of replication.

    One of my jobs execute sp_droppullsubscription, but depending on the type of failure, the pull subscription may or may not be there.

    I was using

    select * from sysobjects where name like 'MSReplication_Subscriptions'

    to check, but I don't think that is right as it is returning unpredicatable results. IS there something else I could check?

    Thanks in advance

  • I'm not sure if it is a good idea to automate replication.

    To check if you have any subscribers, run sp_helppullsubscription at the subscriber on the subscribing database and capture to a temp table the result. There you will have all the active subscribers, and then with a cursor you can drop all the subscribers with

    sp_droppullsubscription.

Viewing 4 posts - 1 through 3 (of 3 total)

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