sp_helpmergepublication (Transact-SQL)

 

Applies To: SQL Server

Returns information about a merge publication. This stored procedure is executed at the Publisher on the publication database.

Topic link icon Transact-SQL Syntax Conventions

  
sp_helpmergepublication [ [ @publication = ] 'publication' ]  
    [ , [ @found = ] 'found' OUTPUT ]  
    [ , [ @publication_id = ] 'publication_id' OUTPUT ]  
    [ , [ @reserved = ] 'reserved' ]  
    [ , [ @publisher = ] 'publisher' ]  
    [ , [ @publisher_db = ] 'publisher_db' ]  

[ @publication= ] 'publication'
The name of the publication. publicationis sysname, with a default of %, which returns information about all merge publications in the current database.

[ @found= ] 'found' OUTPUT
A flag to indicate returning rows. foundis int and an OUTPUT parameter, with a default of NULL. 1 indicates the publication is found. 0 indicates the publication is not found.

[ @publication_id=] 'publication_id' OUTPUT
The publication identification number. publication_id is uniqueidentifier and an OUTPUT parameter, with a default of NULL.

[ @reserved=] 'reserved'
Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. reserved is nvarchar(20), with a default of NULL.

[ @publisher= ] 'publisher'
The name of the Publisher. publisher is sysname, with a default of NULL.

[@publisher_db= ] 'publisher_db'
The name of the publication database. publisher_db is sysname, with a default of NULL.

Column nameData typeDescription
idintSequential order of the publication in the result set list.
namesysnameName of the publication.
descriptionnvarchar(255)Description of the publication.
statustinyintIndicates when publication data is available.
retentionintAmount of time to save metadata about changes for articles in the publication. The units for this time period can be days, weeks, months, or years. For information about units, see the retention_period_unit column.
sync_modetinyintSynchronization mode of this publication:

 0 = Native bulk copy program (bcp utility)

 1 = Character bulk copy
allow_pushintDetermines whether push subscriptions can be created for the given publication. 0 means that a push subscription is not allowed.
allow_pullintDetermines whether pull subscriptions can be created for the given publication. 0 means that a pull subscription is not allowed.
allow_anonymousintDetermines whether anonymous subscriptions can be created for the given publication. 0 means that an anonymous subscription is not allowed.
centralized_conflictsintDetermines whether conflict records are stored on the given Publisher:

 0 = conflict records are stored at both the publisher and at the subscriber that caused the conflict.

 1 = all conflict records are stored at the Publisher.
priorityfloat(8)Priority of the loop-back subscription.
snapshot_readytinyintIndicates whether the snapshot of this publication is ready:

 0 = Snapshot is ready for use.

 1 = Snapshot is not ready for use.
publication_typeintType of publication:

 0 = Snapshot.

 1 = Transactional.

 2 = Merge.
pubiduniqueidentifierUnique identifier of this publication.
snapshot_jobidbinary(16)Job ID of the Snapshot Agent. To obtain the entry for the snapshot job in the sysjobs system table, you must convert this hexadecimal value to uniqueidentifier.
enabled_for_internetintDetermines whether the publication is enabled for the Internet. If 1, the synchronization files for the publication are put into the C:\Program Files\Microsoft SQL Server\MSSQL\Repldata\Ftp directory. The user must create the File Transfer Protocol (FTP) directory. If 0, the publication is not enabled for Internet access.
dynamic_filterintIndicates shether a parameterized row filter is used. 0 means a parameterized row filter is not used.
has_subscriptionbitIndicates whether the publication has any subscriptions. 0 means there are currently no subscriptions to this publication.
snapshot_in_default_folderbitSpecifies if the snapshot files are stored in the default folder.

If 1, snapshot files can be found in the default folder.

If 0, snapshot files are stored in the alternate location specified by alt_snapshot_folder. Alternate locations can be on another server, on a network drive, or on a removable media (such as CD-ROM or removable disks). You can also save the snapshot files to a FTP site, for retrieval by the Subscriber at a later time.

Note: This parameter can be true and still have a location in the alt_snapshot_folder parameter. That combination specifies that the snapshot files are stored in both the default and alternate locations.
alt_snapshot_foldernvarchar(255)Specifies the location of the alternate folder for the snapshot.
pre_snapshot_scriptnvarchar(255)Specifies a pointer to an .sql file that the Merge Agent runs before any of the replicated object scripts when applying the snapshot at a Subscriber.
post_snapshot_scriptnvarchar(255)Specifies a pointer to an .sql file that the Merge Agent runs after all the other replicated object scripts and data have been applied during an initial synchronization.
compress_snapshotbitSpecifies that the snapshot that is written to the alt_snapshot_folder location is compressed into the Microsoft CAB format.
ftp_addresssysnameIs the network address of the FTP service for the Distributor. Specifies where publication snapshot files are located for the Merge Agent to pick up.
ftp_portintIs the port number of the FTP service for the Distributor. ftp_port has a default of 21. Specifies where the publication snapshot files are located for the Merge Agent to pick up.
ftp_subdirectorynvarchar(255)Specifies where the snapshot files are available for the Merge Agent to pick up when the snapshot is delivered using FTP.
ftp_loginsysnameIs the username used to connect to the FTP service.
conflict_retentionintSpecifies the retention period, in days, for which conflicts are retained. After the specified number of days has passed, the conflict row is purged from the conflict table.
keep_partition_changesintSpecifies whether synchronization optimization is occurring for this publication. keep_partition_changes has a default of 0. A value of 0 means that synchronization is not optimized, and the partitions sent to all Subscribers are verified when data changes in a partition.

 1 means that synchronization is optimized, and only Subscribers having rows in the changed partition are affected.

Note: By default, merge publications use precomputed partitions, which provides a greater degree of optimization than this option. For more information, see Parameterized Row Filters and Optimize Parameterized Filter Performance with Precomputed Partitions.
allow_subscription_copyintSpecifies whether the ability to copy the subscription databases that subscribe to this publication has been enabled. A value of 0 means copying is not allowed.
allow_synctoalternateintSpecifies whether an alternate synchronization partner is allowed to synchronize with this Publisher. A value of 0 means a synchronization partner is not allowed.
validate_subscriber_infonvarchar(500)Lists the functions that are being used to retrieve Subscriber information and validate the parameterized row filtering criteria on the Subscriber. Assists in verifying that the information is partitioned consistently with each merge.
backward_comp_levelintDatabase compatibility level, and can be one of the following:

 90 = SQL Server 2005

 90 = SQL Server 2005 SP1

 90 = SQL Server 2005 SP2

 100 = SQL Server 2008
publish_to_activedirectorybitSpecifies if the publication information is published to Active Directory. A value of 0 means the publication information is not available from Active Directory.

This parameter has been deprecated and is only supported for the backward compatibility of scripts. You can no longer add publication information to Active Directory.
max_concurrent_mergeintThe number of concurrent merge processes. If 0, there is no limit to the number of concurrent merge processes running at any given time.
max_concurrent_dynamic_snapshotsintThe maximum number of concurrent filtered data snapshot sessions that can be running against the merge publication. If 0, there is no limit to the maximum number of concurrent filtered data snapshot sessions that can run simultaneously against the publication at any given time.
use_partition_groupsintDetermines if precomputed partitions are used. A value of 1 means that precomputed partitions are used.
num_of_articlesintNumber of articles in the publication.
replicate_ddlintIf schema changes to published tables are replicated. A value of 1 means that schema changes are replicated.
publication_numbersmallintNumber assigned to this publication.
allow_subscriber_initiated_snapshotbitDetermines if Subscribers can initiate the filtered data snapshot generation process. A value of 1 means that Subscribers can initiate the snapshot process.
allow_web_synchronizationbitDetermines if the publication is enabled for Web synchronization. A value of 1 means that Web synchronization is enabled.
web_synchronization_urlnvarchar(500)Internet URL that is used for Web synchronization.
allow_partition_realignmentbitDetermines if deletes are sent to the subscriber when modification of the row on the publisher causes it to change its partition. A value of 1 means that deletes are sent to the Subscriber. For more information, see sp_addmergepublication (Transact-SQL).
retention_period_unittinyintDefines the unit that is used when defining retention. This can be one of the following values:

 0 = day

 1 = week

 2 = month

 3 = year
has_downloadonly_articlesbitIndicates if any articles that belong to the publication are download-only articles. A value of 1 indicates that there are download-only articles.
decentralized_conflictsintIndicates whether the conflict records are stored at the Subscriber that caused the conflict. A value of 0 indicates that conflict records are not stored at the Subscriber. A value of 1 indicates that conflict records are stored at the Subscriber.
generation_leveling_thresholdintSpecifies the number of changes that are contained in a generation. A generation is a collection of changes that are delivered to a Publisher or Subscriber
automatic_reinitialization_policybitIndicates whether changes are uploaded from the Subscriber before an automatic reinitialization occurs. A value of 1 indicates that changes are uploaded from the Subscriber before an automatic reinitialization occurs. A value of 0 indicates that changes are not uploaded before an automatic reinitialization.

0 (success) or 1 (failure)

sp_helpmergepublication is used in merge replication.

Members of the publication access list for a publication can execute sp_helpmergepublication for that publication. Members of the db_owner fixed database role on the publication database can execute sp_helpmergepublication for information on all publications.

DECLARE @publication AS sysname;
SET @publication = N'AdvWorksSalesOrdersMerge';

USE [AdventureWorks2012]
EXEC sp_helpmergepublication @publication = @publication;
GO

View and Modify Publication Properties
sp_addmergepublication (Transact-SQL)
sp_changemergepublication (Transact-SQL)
sp_dropmergepublication (Transact-SQL)
Replication Stored Procedures (Transact-SQL)

Community Additions

ADD
Show: