Subscribing to Publications
A subscription is a request for a copy of the data and database objects in a publication. A subscription defines which publication will be received, and where and when it will be received. When planning for subscriptions, consider where you want agent processing to occur. The type of subscription you choose controls where the agent runs. With a push subscription, the Merge Agent or Distribution Agent runs at the Distributor, whereas with a pull subscription, agents run at the Subscribers. After a subscription is created, it cannot be changed from one type to another.
Subscription |
Characteristics |
Use When |
---|---|---|
Push Subscription |
With a push subscription, the Publisher propagates changes to a Subscriber without a request from the Subscriber. Changes can be pushed to Subscribers on demand, continuously, or on a scheduled basis. The Distribution Agent or Merge Agent runs at the Distributor. |
|
Pull Subscription |
With a pull subscription, the Subscriber requests changes made at the Publisher. Pull subscriptions allow the user at the Subscriber to determine when the data changes are synchronized. The Distribution Agent or the Merge Agent runs at the Subscriber. |
|
Merge Replication Subscription Types
All replication types allow push and pull subscriptions. Merge replication uses two additional terms to distinguish subscriptions: client subscriptions and server subscriptions. Both client and server subscription types can be used with push and pull subscriptions. Client subscriptions are appropriate for most Subscribers, whereas server subscriptions are typically used for Subscribers that republish data to other Subscribers. Subscription choice also affects conflict resolution. For more information on subscription types, see the section "Subscription Types" in How Merge Replication Detects and Resolves Conflicts. After a subscription is created, it cannot be changed from one type to another.
Non-SQL Server Subscribers
Oracle and IBM DB2 can subscribe to snapshot and transactional publications using push subscriptions. For more information, see Non-SQL Server Subscribers.
Creating Subscriptions
To create a subscription, you supply the following information:
The name of the publication.
The name of the Subscriber and the subscription database.
Whether the Distribution Agent or Merge Agent runs at the Distributor or at the Subscriber.
Whether the Distribution Agent or Merge Agent runs continuously, on a scheduled basis, or on demand only.
Whether the Snapshot Agent should create an initial snapshot for the subscription and whether the Distribution Agent or Merge Agent should apply that snapshot at the Subscriber.
Accounts under which the Distribution Agent or Merge Agent will run.
For merge replication, the type of subscription: server or client.
To create a push subscription
SQL Server Management Studio: How to: Create a Push Subscription (SQL Server Management Studio)
Replication Transact-SQL programming: How to: Create a Push Subscription (Replication Transact-SQL Programming)
Replication Management Objects (RMO) programming: How to: Create a Push Subscription (RMO Programming)
To view or modify push subscription properties
SQL Server Management Studio: How to: View and Modify Push Subscription Properties (SQL Server Management Studio)
Replication Transact-SQL programming: How to: View and Modify Push Subscription Properties (Replication Transact-SQL Programming)
RMO programming: How to: View and Modify Push Subscription Properties (RMO Programming)
To delete a push subscription
SQL Server Management Studio: How to: Delete a Push Subscription (SQL Server Management Studio)
Replication Transact-SQL programming: How to: Delete a Push Subscription (Replication Transact-SQL Programming)
RMO programming: How to: Delete a Push Subscription (RMO Programming)
Note
Deleting a subscription does not remove published objects from the Subscriber.
To create a pull subscription
SQL Server Management Studio: How to: Create a Pull Subscription (SQL Server Management Studio)
Replication Transact-SQL programming: How to: Create a Pull Subscription (Replication Transact-SQL Programming)
RMO programming: How to: Create a Pull Subscription (RMO Programming)
To view or modify pull subscription properties
SQL Server Management Studio: How to: View and Modify Pull Subscription Properties (SQL Server Management Studio)
Replication Transact-SQL programming: How to: View and Modify Pull Subscription Properties (Replication Transact-SQL Programming)
RMO programming: How to: View and Modify Pull Subscription Properties (RMO Programming)
To delete a pull subscription
SQL Server Management Studio: How to: Delete a Pull Subscription (SQL Server Management Studio)
Replication Transact-SQL programming: How to: Delete a Pull Subscription (Replication Transact-SQL Programming)
RMO programming: How to: Delete a Pull Subscription (RMO Programming)
See Also