sp_addmergepublication (T-SQL)
Creates a new merge publication.
Syntax
sp_addmergepublication [@publication =] 'publication'
[,[@description =] 'description' [,[@retention =] retention]
[,[@sync_mode =] 'sync_mode', [@allow_push =] 'allow_push']
[,[@allow_pull =] 'allow_pull'] [@allow_anonymous =] 'allow_anonymous']
[,[@enabled_for_internet =] 'enabled_for_internet']
[,[@centralized_conflicts =] 'centralized_conflicts']
[,[@dynamic_filters =] 'dynamic_filters']
Arguments
- [@publication =] 'publication'
- Is the name of the merge publication to create. publication is sysname, with no default, and must not be the keyword ALL. The name of the publication must be unique within the database.
- [@description =] 'description'
- Is the publication description. description is nvarchar(255), with a default of NULL.
- [@retention =] retention
- Is the amount of change, in days, to save for the given publication. retention is int, with a default of 60 days. If the subscription does not merge within the retention period, the subscription expires and is removed.
- [@sync_mode =] 'sync_mode'
- Is the mode of the synchronization. sync_mode is nvarchar(10), with a default of native. If native, native-mode bulk copy program output of all tables is produced. If character, character-mode bulk copy program output of all tables is produced.
- [@allow_push =] 'allow_push'
- Is whether push subscriptions can be created for the given publication. allow_push is nvarchar(5), with a default of TRUE, which allows push subscriptions on the publication.
- [@allow_pull =] 'allow_pull'
- Is whether pull subscriptions can be created for the given publication. allow_pull is nvarchar(5), with a default of TRUE, which allows pull subscriptions on the publication.
- [@allow_anonymous =] 'allow_anonymous'
- Is whether anonymous subscriptions can be created for the given publication. allow_anonymous is nvarchar(5), with a default of FALSE, which does not allow anonymous subscriptions on the publication.
- [@enabled_for_internet =] 'enabled_for_internet'
- Is whether the publication is enabled for the Internet. enabled_for_internet is nvarchar(5), with a default of FALSE. If true, the synchronization files for the publication are put into the \Repldata\Ftp directory. The user must set up the Ftp directory.
- [@centralized_conflicts =] 'centralized_conflicts'
- Is whether conflict records are stored on the given Publisher. centralized_conflicts is nvarchar(5), with a default of TRUE. If true, conflict records are stored at the Publisher. If false, conflict records are stored at each Subscriber.
- [@dynamic_filters =] 'dynamic_filters'
- Is whether the publication is filtered on a dynamic clause. dynamic_filter is nvarchar(5), with a default of FALSE.
Return Code Values
0 (success) or 1 (failure)
Remarks
sp_addmergepublication is used in merge replication.
Permissions
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_addmergepublication.
See Also
(c) 1988-98 Microsoft Corporation. All Rights Reserved.