后续版本的 Microsoft SQL Server 将删除该功能。请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
The DisableMergeSubscription method removes the record of a Subscriber-initiated (pull) subscription from the merge publication Publisher and Distributor.
语法
            object
.DisableMergeSubscription(
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 merge replication publication by name.
Prototype (C/C++)
HRESULT DisableMergeSubscription(
SQLDMO_LPCSTR Subscriber,
SQLDMO_LPCSTR SubscriptionDatabase,
SQLDMO_LPCSTR Publication);
备注
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, then, separately remove the record of the subscription at the Publisher and Distributor.
To remove a pull subscription to a merge replication publication
- Establish SQLServer object connection to the Subscriber. 
- Extract the MergePullSubscription object referencing the subscription from the Subscriber MergePullSubscriptions collection. 
- Use the Remove method of the MergePullSubscription object. 
- Establish a SQLServer object connection to the Publisher. 
- Use the DisableMergeSubscription method of the ReplicationDatabase object referencing the published database.