How to: View and Modify Pull Subscription Properties (RMO Programming)

You can modify pull subscriptions and access their properties programmatically by using Replication Management Objects (RMO). The RMO classes you use to view or modify pull subscription properties depend on the type of publication to which the pull subscription is subscribed.

To view or modify properties of a pull subscription to a snapshot or transactional publication

  1. Create a connection to the Subscriber by using the ServerConnection class.

  2. Create an instance of the TransPullSubscription class.

  3. Set the PublicationName, DatabaseName, PublisherName, and PublicationDBName properties.

  4. Set the connection from step 1 for the ConnectionContext property.

  5. Call the LoadProperties method to get the properties of the object. If this method returns false, either the subscription properties in step 3 were defined incorrectly or the subscription does not exist on the server.

  6. (Optional) To change properties, set a new value for one of the TransPullSubscription properties that can be set, and then call the CommitPropertyChanges method.

  7. (Optional) To view the new settings, call the Refresh method to reload the properties for the article.

  8. Close all connections.

To view or modify properties of a pull subscription to a merge publication

  1. Create a connection to the Subscriber by using the ServerConnection class.

  2. Create an instance of the MergePullSubscription class.

  3. Set the PublicationName, DatabaseName, PublisherName, and PublicationDBName properties.

  4. Set the connection from step 1 for the ConnectionContext property.

  5. Call the LoadProperties method to get the properties of the object. If this method returns false, either the subscription properties in step 3 were defined incorrectly or the subscription does not exist on the server.

  6. (Optional) To change properties, set a new value for one of the MergePullSubscription properties that can be set, and then call the CommitPropertyChanges method.

  7. (Optional) To view the new settings, call the Refresh method to reload the properties for the article.

  8. Close all connections.

请参阅

任务

如何创建请求订阅(复制 Transact-SQL 编程)

其他资源

如何查看和修改请求订阅属性 (SQL Server Management Studio)
订阅发布

帮助和信息

获取 SQL Server 2005 帮助