Search code examples
sqlreplicationpullsubscriptions

What is the correct way to completely eliminate Replication for a specific Publication


I have two servers:

Server 1 (Publisher)

Server 2 (Subscriber)

I have a set up a PULL subscription.

What are the correct steps to programmatically remove this entire replication?

I need to know this because I have a custom application that does Replication and in an event of errors, I need to "start fresh" so I need to delete the publication, subscription and any other objects related to it...


Solution

  • The steps are:

    1. Delete the pull subscription
    2. Delete the publication

    Here are some links to assist you:

    Delete a Pull Subscription

    Delete a Publication

    Both examples show how to delete the pull subscription and publication using SSMS, T-SQL, and RMO. T-SQL or RMO would be the way to go to do it programmatically. I hope this helps.