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