Condividi tramite


DisableTransSubscription Method

Questa funzionalità verrà rimossa in una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa funzionalità in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.

The DisableTransSubscription method removes the record of a Subscriber-initiated (pull) subscription from the transactional or snapshot publication Publisher and Distributor.

Sintassi

object
.DisableTransSubscription(
Subscriber
,
SubscriptionDatabase
,
Publication
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Subscriber
    String that specifies an existing Subscriber by name.
  • SubscriptionDatabase
    String that specifies the subscribed database by name.
  • Publication
    String that specifies an existing transactional or snapshot replication publication by name.

Prototype (C/C++)

HRESULT DisableTransSubscription(
SQLDMO_LPCSTR Subscriber,
SQLDMO_LPCSTR SubscriptionDatabase,
SQLDMO_LPCSTR Publication);

Osservazioni

Removing a pull subscription by using SQL Distributed Management Objects (SQL-DMO) is a two-step process. The application must remove the subscription at the Subscriber, and 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

  1. Establish a SQLServer object connection to the Subscriber.

  2. Extract the TransPullSubscription object referencing the subscription from the Subscriber TransPullSubscriptions collection.

  3. Use the Remove method of the TransPullSubscription object.

  4. Establish a SQLServer object connection to the Publisher.

  5. Use the DisableTransSubscription method of the ReplicationDatabase object referencing the published database.

Applies To:

ReplicationDatabase Object