Is the name of the publication that contains the article. publication is sysname, with no default.

[ @article= ] 'article'

Is the name of the article. The name must be unique within the publication. article is sysname, with no default. article must be on the local computer running Microsoft SQL Server, and must conform to the rules for identifiers.

[ @source_object= ] 'source_object'

Is the database object to be published. source_object is sysname, with no default. For more information about the types of objects that can be published using merge replication, see Publishing Data and Database Objects.

[ @type= ] 'type'

Is the type of article. type is sysname, with a default of table, and can be one of the following values.

Value

Description

table (default)

Table with schema and data. Replication monitors the table to determine data to be replicated.

func schema only

Function with schema only.

indexed view schema only

Indexed view with schema only.

proc schema only

Stored procedure with schema only.

synonym schema only

Synonym with schema only.

view schema only

View with schema only.

[ @description= ] 'description'

Is a description of the article. description is nvarchar(255), with a default of NULL.

[ @column_tracking= ] 'column_tracking'

Is the setting for column-level tracking. column_tracking is nvarchar(10), with a default of FALSE. true turns on column tracking. false turns off column tracking and leaves conflict detection at the row level. If the table is already published in other merge publications, you must use the same column tracking value used by existing articles based on this table. This parameter is specific to table articles only.

Note:

If row tracking is used for conflict detection (the default), the base table can include a maximum of 1,024 columns, but columns must be filtered from the article so that a maximum of 246 columns is published. If column tracking is used, the base table can include a maximum of 246 columns. For more information about the tracking level, see the "Tracking Level" section of How Merge Replication Detects and Resolves Conflicts.

[ @status= ] 'status'

Is the status of the article. status is nvarchar(10), with a default of unsynced. If active, the initial processing script to publish the table is run. If unsynced, the initial processing script to publish the table is run at the next time the Snapshot Agent runs.

[ @pre_creation_cmd= ] 'pre_creation_cmd'

Specifies what the system is to do if the table exists at the subscriber when applying the snapshot. pre_creation_cmd is nvarchar(10), and can be one of the following values.

Is the path and name of an optional article schema script used to create the article in the subscription database. creation_script is nvarchar(255), with a default of NULL.

Note:

Creation scripts are not run on SQL Server 2005 Compact Edition Subscribers.

[ @schema_option= ] schema_option

Is a bitmap of the schema generation option for the given article. schema_option is binary(8), and can be the | (Bitwise OR) product of one or more of these values.

Value

Description

0x00

Disables scripting by the Snapshot Agent and uses the provided schema precreation script defined in creation_script.

0x01

Generates the object creation (CREATE TABLE, CREATE PROCEDURE, and so on). This is the default value for stored procedure articles.

0x10

Generates a corresponding clustered index. Even if this option is not set, indexes related to primary keys and UNIQUE constraints are generated if they are already defined on a published table.

0x20

Converts user-defined data types (UDT) to base data types at the Subscriber. This option cannot be used when there is a CHECK or DEFAULT constraint on a UDT column, if a UDT column is part of the primary key, or if a computed column references a UDT column.

0x40

Generates corresponding nonclustered indexes. Even if this option is not set, indexes related to primary keys and UNIQUE constraints are generated if they are already defined on a published table.

0x80

Replicates PRIMARY KEY constraints. Any indexes related to the constraint are also replicated, even if options 0x10 and 0x40 are not enabled.

0x100

Replicates user triggers on a table article, if defined.

0x200

Replicates FOREIGN KEY constraints. If the referenced table is not part of a publication, all FOREIGN KEY constraints on a published table are not replicated.

0x400

Replicates CHECK constraints.

0x800

Replicates defaults.

0x1000

Replicates column-level collation.

0x2000

Replicates extended properties associated with the published article source object.

0x4000

Replicates UNIQUE constraints. Any indexes related to the constraint are also replicated, even if options 0x10 and 0x40 are not enabled.

0x8000

This option is not valid for SQL Server 2005 Publishers.

0x10000

Replicates CHECK constraints as NOT FOR REPLICATION so that the constraints are not enforced during synchronization.

0x20000

Replicates FOREIGN KEY constraints as NOT FOR REPLICATION so that the constraints are not enforced during synchronization.

0x40000

Replicates filegroups associated with a partitioned table or index.

0x80000

Replicates the partition scheme for a partitioned table.

0x100000

Replicates the partition scheme for a partitioned index.

0x200000

Replicates table statistics.

0x400000

Replicates default Bindings.

0x800000

Replicates rule Bindings.

0x1000000

Replicates the full-text index.

0x2000000

XML schema collections bound to xml columns are not replicated.

0x4000000

Replicates indexes on xml columns.

0x8000000

Creates any schemas not already present on the subscriber.

0x10000000

Converts xml columns to ntext on the Subscriber.

0x20000000

Converts large object data types introduced in SQL Server 2005 to data types supported on earlier versions of Microsoft SQL Server, based on the following mapping.

SQL Server 2005 data type

Down-level data type

nvarchar(max) ntext

varchar(max) text

varbinary(max) image

0x40000000

Replicates permissions.

0x80000000

Attempts to drop dependencies to any objects that are not part of the publication.

If this value is NULL, the system auto-generates a valid schema option for the article. The Default Schema Option table in the Remarks section shows the value that is chosen based upon the article type. Also, not all schema_option values are valid for every type of replication and article type. The Valid Schema Option table given in the Remarks shows the options that can be specified for a given article type.

Note:

The schema_option parameter only affects replication options for the initial snapshot. Once the initial schema has been generated by the Snapshot Agent and applied at the Subscriber, the replication of publication schema changes to the Subscriber occur based on schema change replication rules and the replicate_ddl parameter setting specified in sp_addmergepublication. For more information, see Making Schema Changes on Publication Databases.

[ @subset_filterclause= ] 'subset_filterclause'

Is a WHERE clause specifying the horizontal filtering of a table article without the word WHERE included. subset_filterclause is of nvarchar(1000), with a default of an empty string.

Important:

For performance reasons, we recommended that you not apply functions to column names in parameterized row filter clauses, such as LEFT([MyColumn]) = SUSER_SNAME(). If you use HOST_NAME in a filter clause and override the HOST_NAME value, you might have to convert data types by using CONVERT. For more information about best practices for this case, see the section "Overriding the HOST_NAME() Value" in Parameterized Row Filters.

[ @article_resolver= ] 'article_resolver'

Is the COM-based resolver used to resolve conflicts on the table article or the .NET Framework assembly invoked to execute custom business logic on the table article. article_resolver is varchar(255), with a default of NULL. Available values for this parameter are listed in Microsoft Custom Resolvers. If the value provided is not one of the Microsoft resolvers, SQL Server uses the specified resolver instead of the system-supplied resolver. Use sp_enumcustomresolvers to enumerate the list of available custom resolvers. For more information, see Executing Business Logic During Merge Synchronization and Advanced Merge Replication Conflict Detection and Resolution.

[ @resolver_info= ] 'resolver_info'

Is used to specify additional information required by a custom resolver. Some of the Microsoft Resolvers require a column provided as input to the resolver. resolver_info is nvarchar(255), with a default of NULL. For more information, see Microsoft COM-Based Resolvers.

[ @source_owner= ] 'source_owner'

Is the name of the owner of the source_object. source_owner is sysname, with a default of NULL. If NULL, the current user is assumed to be the owner.

[ @destination_owner= ] 'destination_owner'

Is the owner of the object in the subscription database, if not 'dbo'. destination_owner is sysname, with a default of NULL. If NULL, 'dbo' is assumed to be the owner.

[ @vertical_partition= ] 'column_filter'

Enables and disables column filtering on a table article. vertical_partition is nvarchar(5) with a default of FALSE.

false indicates there is no vertical filtering and publishes all columns.

true clears all columns except the declared primary key and ROWGUID columns. Columns are added by using sp_mergearticlecolumn.

[ @auto_identity_range= ] 'automatic_identity_range'

Enables and disables automatic identity range handling for this table article on a publication at the time it is created. auto_identity_range is nvarchar(5), with a default of FALSE. true enables automatic identity range handling, while false disables it.

Note:

auto_identity_range has been deprecated and is provided for backward compatibility only. You should use identityrangemanagementoption for specifying identity range management options. For more information, see Replicating Identity Columns.

[ @pub_identity_range= ] pub_identity_range

Controls the identity range size allocated to a Subscriber with a server subscription when automatic identity range management is used. This identity range is reserved for a republishing Subscriber to allocate to its own Subscribers. pub_identity_range is bigint, with a default of NULL. You must specify this parameter if identityrangemanagementoption is auto or if auto_identity_range is true.

[ @identity_range= ] identity_range

Controls the identity range size allocated both to the Publisher and to the Subscriber when automatic identity range management is used. identity_range is bigint, with a default of NULL. You must specify this parameter if identityrangemanagementoption is auto or if auto_identity_range is true.

Percentage value that controls when the Merge Agent assigns a new identity range. When the percentage of values specified in threshold is used, the Merge Agent creates a new identity range. threshold is int, with a default of NULL. You must specify this parameter if identityrangemanagementoption is auto or if auto_identity_range is true.

[ @verify_resolver_signature= ] verify_resolver_signature

Specifies if a digital signature is verified before using a resolver in merge replication. verify_resolver_signature is int, with a default of 1.

0 specifies that the signature will not be verified.

1 specifies that the signature will be verified to see if it is from a trusted source.

[ @destination_object= ] 'destination_object'

Is the name of the object in the subscription database. destination_object is sysname, with a default value of what is in @source_object. This parameter can be specified only if the article is a schema-only article, such as stored procedures, views, and UDFs. If the article specified is a table article, the value in @source_object overrides the value in destination_object.

[ @allow_interactive_resolver= ] 'allow_interactive_resolver'

Enables or disables the use of the Interactive Resolver on an article. allow_interactive_resolver is nvarchar(5), with a default of FALSE. true enables the use of the Interactive Resolver on the article; false disables it.

This parameter has been deprecated and is maintained for backward compatibility of scripts.

[ @check_permissions= ] check_permissions

Is a bitmap of the table-level permissions that are verified when the Merge Agent applies changes to the Publisher. If the Publisher login/user account used by the merge process does not have the correct table permissions, the invalid changes are logged as conflicts. check_permissions is int, and can be the | (Bitwise OR) product of one or more of the following values.

Value

Description

0x00 (default)

Permissions are not checked.

0x10

Checks permissions at the Publisher before insert operations made at a Subscriber can be uploaded.

0x20

Checks permissions at the Publisher before update operations made at a Subscriber can be uploaded.

0x40

Checks permissions at the Publisher before delete operations made at a Subscriber can be uploaded.

[ @force_invalidate_snapshot= ] force_invalidate_snapshot

Acknowledges that the action taken by this stored procedure may invalidate an existing snapshot. force_invalidate_snapshot is a bit, with a default of 0.

0 specifies that adding an article does not cause the snapshot to be invalid. If the stored procedure detects that the change does require a new snapshot, an error occurs and no changes are made.

1 specifies that adding an article may cause the snapshot to be invalid, and if there are existing subscriptions that require a new snapshot, gives permission for the existing snapshot to be marked as obsolete and a new snapshot generated. force_invalidate_snapshot is set to 1 when adding an article to a publication with an existing snapshot.

[ @published_in_tran_pub= ] 'published_in_tran_pub'

Indicates that an article in a merge publication is also published in a transactional publication. published_in_tran_pub is nvarchar(5), with a default of FALSE. true specifies that the article is also published in a transactional publication.

[ @force_reinit_subscription= ] force_reinit_subscription

Acknowledges that the action taken by this stored procedure may require existing subscriptions to be reinitialized. force_reinit_subscription is a bit, with a default of 0.

0 specifies that adding an article does not cause the subscription to be reinitialized. If the stored procedure detects that the change would require existing subscriptions to be reinitialized, an error occurs and no changes are made.

1 means that changes to the merge article causes existing subscriptions to be reinitialized, and gives permission for the subscription reinitialization to occur. force_reinit_subscription is set to 1 when subset_filterclause specifies a parameterized row filter.

Specifies the level of conflict resolution for an article that is a member of a logical record. logical_record_level_conflict_resolution is nvarchar(5), with a default of FALSE.

true specifies that the entire winning logical record overwrites the losing logical record.

false specifies that winning rows are not constrained to the logical record. If logical_record_level_conflict_detection is true, then logical_record_level_conflict_resolution must also be set to true. For more information, see Grouping Changes to Related Rows with Logical Records.

Note:

Because logical records are not supported by SQL Server 2005 Compact Edition Subscribers, you must specify a value of false for logical_record_level_conflict_resolution to support these Subscribers.

[ @partition_options= ] partition_options

Defines the way in which data in the article is partitioned, which enables performance optimizations when all rows belong in only one partition or in only one subscription. partition_options is tinyint, and can be one of the following values.

Value

Description

0 (default)

The filtering for the article either is static or does not yield a unique subset of data for each partition, that is, an "overlapping" partition.

1

The partitions are overlapping, and data manipulation language (DML) updates made at the Subscriber cannot change the partition to which a row belongs.

2

The filtering for the article yields non-overlapping partitions, but multiple Subscribers can receive the same partition.

3

The filtering for the article yields non-overlapping partitions that are unique for each subscription.

Note:

If the source table for an article is already published in another publication, then the value of partition_options must be the same for both articles.

[ @processing_order= ] processing_order

Indicates the processing order of articles in a merge publication. processing_order is int, with a default of 0. 0 specifies that the article is unordered, and any other value represents the ordinal value of the processing order for this article. Articles are processed in order from lowest to highest value. If two articles have the same value, processing order is determined by the order of the article nickname in the sysmergearticles system table. For more information, see Specifying the Processing Order of Merge Articles.

No restrictions. Changes made at the Subscriber are uploaded to the Publisher.

1

Changes are allowed at the Subscriber, but they are not uploaded to the Publisher.

2

Changes are not allowed at the Subscriber.

Note:

If the source table for an article is already published in another publication, the value of subscriber_upload_options must be the same for both articles.

[ @identityrangemanagementoption= ] identityrangemanagementoption

Specifies how identity range management is handled for the article. identityrangemanagementoption is nvarchar(10), and can be one of the following values.

Value

Description

none

Disables identity range management.

manual

Marks the identity column using NOT FOR REPLICATION to enable manual identity range handling.

auto

Specifies automatic management of identity ranges.

NULL(default)

Defaults to none when the value of auto_identity_range is not true.

For backward compatibility, when the value of identityrangemanagementoption is NULL, the value of auto_identity_range is checked. However, when the value of identityrangemanagementoption is not NULL, then the value of auto_identity_range is ignored. For more information, see Replicating Identity Columns.

[ @delete_tracking= ] 'delete_tracking'

Indicates whether deletes are replicated. delete_tracking is nvarchar(5), with a default of TRUE. false indicates that deletes are not replicated, and true indicates that deletes are replicated, which is the usual behavior for merge replication. When delete_tracking is set to false, rows deleted at the Subscriber must be manually removed at the Publisher, and rows deleted at the Publisher must be manually removed at the Subscriber.

Important:

Setting delete_tracking to false results in non-convergence. If the source table for an article is already published in another publication, then the value of delete_tracking must be the same for both articles.

Note:

delete_tracking options cannot be set using the New Publication Wizard or the Publication Properties dialog box.

[ @compensate_for_errors= ] 'compensate_for_errors'

Indicates if compensating actions are taken when errors are encountered during synchronization. compensate_for_errors is nvarchar(5), with a default of FALSE. When set to true, changes that cannot be applied at a Subscriber or Publisher during synchronization always lead to compensating actions to undo the change; however, one incorrectly configured Subscriber that generates an error can cause changes at other Subscribers and Publishers to be undone. false disables these compensating actions, however, the errors are still logged as with compensation and subsequent merges continues to attempt to apply the changes until successful.

Note:

For pull subscriptions at Subscribers running Microsoft SQL Server 2000 version 8.00.858 and earlier (which includes SP3), compensating actions still occur even with compensate_for_errors set to false.

Important:

Although data in the affected rows might appear to be out of convergence, as soon as you address any errors, changes can be applied and data will converge. If the source table for an article is already published in another publication, then the value of compensate_for_errors must be the same for both articles.

[ @stream_blob_columns= ] 'stream_blob_columns'

Specifies that a data stream optimization be used when replicating binary large object columns. stream_blob_columns is nvarchar(5), with a default of FALSE. true means that the optimization will be attempted.

Important:

Enabling this memory optimization may reduce the performance of the Merge Agent during synchronization. This option should only be used when replicating columns that contain megabytes of data.

Note:

Certain merge replication functionalities, such as logical records, can still prevent the stream optimization from being used when replicating binary large objects even with stream_blob_columns set to true.

When you publish objects, their definitions are copied to Subscribers. If you are publishing a database object that depends on one or more other objects, you must publish all referenced objects. For example, if you publish a view that depends on a table, you must publish the table also.

If you specify a value of 3 for partition_options, there can be only a single subscription for each partition of data in that article. If a second subscription is created in which the filtering criterion of the new subscription resolves to the same partition as the existing subscription, the existing subscription is dropped.

When specifying a value of 3 for partition_options, metadata is cleaned-up whenever the Merge Agent runs and the partitioned snapshot expires more quickly. When using this option, you should consider enabling subscriber requested partitioned snapshot. For more information, see Snapshots for Merge Publications with Parameterized Filters.

Adding an article with a static horizontal filter, using subset_filterclause, to an existing publication with articles that have parameterized filters requires the subscriptions be reinitialized.

When specifying processing_order, we recommend leaving gaps between the article order values, which makes it easier to set new values in the future. For example, if you have three articles Article1, Article2, and Article3, set processing_order to 10, 20, and 30, rather than 1, 2, and 3. For more information, see Specifying the Processing Order of Merge Articles.

Default Schema Option Table

This table describes the default value that is set by the stored procedure if a NULL value is specified for schema_option, which depends on article type.