sp_addreplicateart

Description

Creates a new replicate article (or articles) in a specified subscription.

Syntax

sp_addreplicateart sub_name [, pri_art [, rep_art 
	[, field_nums 
	[, where_clause]]]]

Parameters

sub_name

is the name of the subscription to which the new article is added.

pri_art

is the name of a primary article. Primary article names can be specified in the form owner.name.

rep_art

is the name of a replicate article, if different from the primary article. This parameter can be used when the name of the replicate object is different from the name of the primary object, which is always the same as the name of the primary article. Replicate article names can be specified in the form owner.name.

field_nums

is one or more numbers that identify the published fields to be subscribed to.

where_clause

is a SQL-type where clause that further selects the published data to be received by the replicate object identified by the replicate article. The SQL keyword where is optional.

Examples

Example 1

sp_addreplicateart subdoc, table1, @field_nums="2-4"

Creates a new replicate article in the subscription subdoc, for the primary article table1, subscribing only to published fields 2, 3, and 4 in the primary article.

Example 2

sp_addreplicateart subdoc, table1, @where_clause="where style = 'round' or 
style = 'square'"

Creates a new replicate article in the subscription subdoc, for the primary article table1, subscribing to all published fields in the primary article, and replicating only rows in which the value of style is either round or square.

Example 3

sp_addreplicateart subdoc, table1, reptable1, "1,3-4", "where style = 'round' or style = 'square'" 

Creates a new replicate article in the subscription subdoc, for the primary article table1, with the replicate object named reptable1, subscribing only to published fields 1, 3, and 4 in the primary article, and replicating only rows in which the value of style is either round or square.

Usage

See also

sp_addprimaryart, sp_addreplicateconn, sp_addsub, sp_helpreplicateart, sp_helpreplicateconn, sp_helpsub