Examples are based on 2 subscribers from a publisher with 2 articles.

Heres a view of the subscriptions at the start

-- Find all subscribers to publication
EXEC sp_helpSubscription

sp_dropsubscription1

 

 

Drop an Article from a single Subscriber

-- Drop Article T2 from THIRD Instance
EXEC sp_dropsubscription @publication = 'repTest', @article = 't2',
    @subscriber = 'REXGBAD-BLQGV4J\THIRD' , @destination_db = 'repTestThird'

sp_dropsubscription2

Drop an Article from all subscribers

-- Drop Article T from all subscribers
EXEC sp_dropsubscription @publication = 'repTest', @article = 't',
    @subscriber = 'all'

sp_dropsubscription3

Drop Single Subscriber

-- SP Ran on Publisher
EXEC sp_dropsubscription
@publication= 'reptest', @subscriber = 'REXGBAD-BLQGV4J\SECONDARY' , @article = 'all'

Drop all subscribers

-- SP Ran on Publisher
EXEC sp_dropsubscription
@publication= 'reptest', @subscriber = 'all' , @article = 'all'

 

— NOTE
remember if you are removing a subscriber from a publication you will also need to run sp_subscription_cleanup

-- run on subscriber
EXEC sp_subscription_cleanup @publisher = 'REXGBAD-BLQGV4J', @publisher_db = 'reptest', @publication = 'repTest'
Advertisements