sp_addpullsubscription (T-SQL)
Adds a pull or an anonymous subscription at the current database of the Subscriber.
Syntax
sp_addpullsubscription [@publisher =] 'publisher',
[@publisher_db =] 'publisher_db', [@publication =] 'publication'
[,[@independent_agent =] 'independent_agent']
[,[@subscription_type =] 'subscription_type']
[,[@description =] 'description'] [,[@update_mode =] 'update_mode']
[,[@immediate_sync =] immediate_sync]
Arguments
- [@publisher =] 'publisher'
- Is the name of the Publisher. publisher is sysname, with no default.
- [@publisher_db =] 'publisher_db'
- Is the name of the Publisher database. publisher_db is sysname, with no default.
- [@publication =] 'publication'
- Is the name of the publication. publication is sysname, with no default.
- [@independent_agent =] 'independent_agent'
- Is whether there is a stand-alone Distribution Agent for this publication. independent_agent is nvarchar(5), with a default of true. If true, there is a stand-alone Distribution Agent for this publication. If false, there is one Distribution Agent for each Publisher database/Subscriber database pair. independent_agent is a property of the publication and must have the same value here as it has at the Publisher.
- [@subscription_type =] 'subscription_type'
- Is the subscription type of the publication. subscription_type is nvarchar(9), and can be one of these values.
Value |
Description |
pull |
Pull subscription |
anonymous (default) |
Anonymous subscription |
- [@description =] 'description'
- Is the description of the publication. description is nvarchar(100), with a default of NULL.
- [@update_mode =] 'update_mode'
- Is the type of update. update_mode is nvarchar(15), and can be one of these values.
Value |
Description |
read-only (default) |
Disables support for immediate-updating Subscribers. |
synctran |
Enables support for immediate-updating Subscribers. |
- [@immediate_sync =] immediate_sync
- Is whether the synchronization files are created or re-created each time the Snapshot Agent runs. immediate_sync is bit with a default of 1, and must be set to the same value as immediate_sync in sp_addpublication. immediate_sync is a property of the publication and must have the same value here as it has at the Publisher.
Return Code Values
0 (success) or 1 (failure)
Remarks
sp_addpullsubscription is used in snapshot and transactional replication.
If the MSreplication_subscriptions table does not exist at the Subscriber, sp_addspullsubscription creates it. It also adds a row to the MSreplication_subscriptions table. For pull subscriptions, sp_addsubscription should be called at the Publisher first.
Permissions
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_addpullsubscription.
See Also
(c) 1988-98 Microsoft Corporation. All Rights Reserved.