The DisableTransSubscription method removes the record of a Subscriber-initiated (pull) subscription from the transactional or snapshot publication Publisher and Distributor.
object.DisableTransSubscription( Subscriber, SubscriptionDatabase,
Publication )
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list |
Subscriber | String specifying an existing Subscriber by name |
SubscriptionDatabase | String specifying the subscribed database by name |
Publication | String specifying an existing transactional or snapshot replication publication by name |
Removing a pull subscription by using SQL-DMO is a two-step process. The application must remove the subscription at the Subscriber, then, separately, remove the record of the subscription at the Publisher and Distributor.
To remove a pull subscription to a transactional or snapshot replication publication
HRESULT DisableTransSubscription(
SQLDMO_LPCSTR Subscriber,
SQLDMO_LPCSTR SubscriptionDatabase,
SQLDMO_LPCSTR Publication);