title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | ms.custom | helpviewer_keywords | monikerRange | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
View and Modify Pull Subscription Properties |
View and Modify Pull Subscription Properties |
MashaMSFT |
mathoma |
09/25/2024 |
sql |
replication |
how-to |
|
|
=azuresqldb-mi-current||>=sql-server-2016 |
[!INCLUDE SQL Server SQL MI] This topic describes how to view and modify pull subscription properties in [!INCLUDEssnoversion] by using [!INCLUDEssManStudioFull], [!INCLUDEtsql], or Replication Management Objects (RMO).
In This Topic
-
To view and modify pull subscription properties, using:
View pull subscription properties from the Publisher or the Subscriber in the Subscription Properties - <Publisher>: <PublicationDatabase> dialog box, which is available from [!INCLUDEssManStudioFull]. More properties are visible from the Subscriber, and properties can be modified at the Subscriber. You can also view properties from the Publisher on the All Subscriptions tab, which is available in Replication Monitor. For information about starting Replication Monitor, see Start the Replication Monitor.
-
Connect to the Publisher in [!INCLUDEssManStudio], and then expand the server node.
-
Expand the Replication folder, and then expand the Local Publications folder.
-
Expand the appropriate publication, right-click a subscription, and then click Properties.
-
View properties, and then click OK.
-
Connect to the Subscriber in [!INCLUDEssManStudio], and then expand the server node.
-
Expand the Replication folder, and then expand the Local Subscriptions folder.
-
Right-click a subscription, and then click Properties.
-
Modify any properties if necessary, and then click OK.
-
Expand a Publisher group in the left pane of Replication Monitor, expand a Publisher, and then click a publication.
-
Click the All Subscriptions tab.
-
Right-click a subscription, and then click Properties.
-
View properties, and then click OK.
Pull subscriptions can be modified and their properties accessed programmatically using replication stored procedures. The stored procedures used depend on the type of publication to which the subscription belongs.
-
At the Subscriber, execute sp_helppullsubscription. Specify
@publisher
,@publisher_db
, and@publication
. This returns information about the subscription that is stored in system tables at the Subscriber. -
At the Subscriber, execute sp_helpsubscription_properties. Specify
@publisher
,@publisher_db
,@publication
, and one of the following values for@publication_type
:-
0 - Subscription belongs to a transactional publication.
-
1 - Subscription belongs to a snapshot publication.
-
-
At the Publisher, execute sp_helpsubscription. Specify
@publication
and@subscriber
. -
At the Publisher, execute sp_helpsubscriberinfo, specifying
@subscriber
. This displays information about the Subscriber.
-
At the Subscriber, execute sp_change_subscription_properties, specifying
@publisher
,@publisher_db
,@publication
, a value of either 0 (transactional) or 1 (snapshot) for@publication_type
, the subscription property being changed as@property
, and the new value as@value
. -
(Optional) At the Subscriber on the subscription database, execute sp_changesubscriptiondtsinfo. Specify the ID of the Distribution Agent job for
@jobid
, and the following Data Transformation Services (DTS) package properties:-
@dts_package_name
-
dts_package_password
-
@dts_package_location
This changes the DTS package properties of a subscription.
[!NOTE]
The job ID can be obtained by executing sp_helpsubscription. -
-
At the Subscriber, execute sp_helpmergepullsubscription. Specify
@publisher
,@publisher_db
, and@publication
. -
At the Subscriber, execute sp_helpsubscription_properties. Specify
@publisher
,@publisher_db
,@publication
, and a value of 2 for@publication_type
. -
At the Publisher, execute sp_helpmergesubscription to display subscription information. To return information on a specific subscription, you must specify
@publication
,@subscriber
, and a value of pull for @subscription_type. -
At the Publisher, execute sp_helpsubscriberinfo, specifying
@subscriber
. This displays information about the Subscriber.
- At the Subscriber, execute sp_changemergepullsubscription. Specify
@publication
,@publisher
,@publisher_db
, the subscription property being changed as@property
, and the new value as@value
.
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.
-
Create a connection to the Subscriber by using the xref:Microsoft.SqlServer.Management.Common.ServerConnection class.
-
Create an instance of the xref:Microsoft.SqlServer.Replication.TransPullSubscription class.
-
Set the xref:Microsoft.SqlServer.Replication.PullSubscription.PublicationName%2A, xref:Microsoft.SqlServer.Replication.PullSubscription.DatabaseName%2A, xref:Microsoft.SqlServer.Replication.PullSubscription.PublisherName%2A, and xref:Microsoft.SqlServer.Replication.PullSubscription.PublicationDBName%2A properties.
-
Set the connection from step 1 for the xref:Microsoft.SqlServer.Replication.ReplicationObject.ConnectionContext%2A property.
-
Call the xref:Microsoft.SqlServer.Replication.ReplicationObject.LoadProperties%2A 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.
-
(Optional) To change properties, set a new value for one of the xref:Microsoft.SqlServer.Replication.TransPullSubscription properties that can be set, and then call the xref:Microsoft.SqlServer.Replication.ReplicationObject.CommitPropertyChanges%2A method.
-
(Optional) To view the new settings, call the xref:Microsoft.SqlServer.Replication.ReplicationObject.Refresh%2A method to reload the properties for the article.
-
Close all connections.
-
Create a connection to the Subscriber by using the xref:Microsoft.SqlServer.Management.Common.ServerConnection class.
-
Create an instance of the xref:Microsoft.SqlServer.Replication.MergePullSubscription class.
-
Set the xref:Microsoft.SqlServer.Replication.PullSubscription.PublicationName%2A, xref:Microsoft.SqlServer.Replication.PullSubscription.DatabaseName%2A, xref:Microsoft.SqlServer.Replication.PullSubscription.PublisherName%2A, and xref:Microsoft.SqlServer.Replication.PullSubscription.PublicationDBName%2A properties.
-
Set the connection from step 1 for the xref:Microsoft.SqlServer.Replication.ReplicationObject.ConnectionContext%2A property.
-
Call the xref:Microsoft.SqlServer.Replication.ReplicationObject.LoadProperties%2A 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.
-
(Optional) To change properties, set a new value for one of the xref:Microsoft.SqlServer.Replication.MergePullSubscription properties that can be set, and then call the xref:Microsoft.SqlServer.Replication.ReplicationObject.CommitPropertyChanges%2A method.
-
(Optional) To view the new settings, call the xref:Microsoft.SqlServer.Replication.ReplicationObject.Refresh%2A method to reload the properties for the article.
-
Close all connections.