Creates an article for a table or function replication definition and specifies the publication that is to contain the article.
create article article_name for pub_name with primary at data_server.database with replication definition {table_rep_def | function_rep_def} [where {column_name | @param_name} {< | > | >= | <= | = | &} value [and {column_name | @param_name} {< | > | >= | <= | = | &} value]... [or where {column_name | @param_name} {< | > | >= | <= | = | &} value [and {column_name | @param_name} {< | > | >= | <= | = | &} value]...]...]
A where clause is composed of one or more simple comparisons, where a searchable column or searchable parameter is compared to a literal value with one of the following relational operators: <, >, <=, >=, =, or &. (The & operator is supported only for rs_address columns or parameters.) You can join comparisons with the keyword and.
Column or parameter names used in a where clause must also be included in the searchable columns list of the table replication definition or the searchable parameters list of the function replication definition.
You can include multiple where clauses in an article, separated with the keyword or.
The maximum size of a where clause in an article is 255 characters.
Column or parameter names used in the expression must be included in the searchable columns or searchable parameters list of the replication definition.
create article titles_art for publication pubs2_pub with primary at TOKYO_DS.pubs2 with replication definition titles_rep
create article titles_art for publication pubs2_pub with primary at TOKYO_DS.pubs2 with replication definition titles_rep where type = 'popular_comp'
create article titles_art for publication pubs2_pub with primary at TOKYO_DS.pubs2 with replication definition titles_rep where type = 'popular_comp' or where type = 'trad_cook'
Use create article to specify a replication definition for which you want to replicate data using a specified publication. Optional where clauses help determine which data is replicated.
Execute create article at the Replication Server that manages the database where the primary data is stored.
Using create article automatically invalidates the publication the article is for. You cannot create new subscriptions until you validate the publication. You cannot replicate data for the new articles until you refresh the subscription.
For more information about working with replication definitions, articles, and publications, see the Replication Server Administration Guide Volume 1.
For more information about subscribing to publications, see the Replication Server Administration Guide Volume 1 > Managing Subscriptions.
Replication Server distributes information about a publication and its articles to a replicate site only when you create or refresh a subscription for the publication.
Requirements for Using create article
Adding Articles to a New Publication
After you create a publication, you use create article to create articles and assign them to the publication. An article specifies a table replication definition or function replication definition and a parent publication. Optionally, it may also include where clauses according to the needs of the subscribing replicate site.
A publication must contain at least one article before it can be validated and before you can create subscriptions for it. See create publication command for more information.
Articles and Subscriptions
When you create a subscription for a publication, Replication Server creates an internal subscription for each of its articles.
Including multiple where clauses for an article, separated by the or keyword, allows you to work around the Replication Server restriction that allows only one where clause per subscription. A publication subscription cannot include a where clause—use where clauses in the articles instead.
Adding Articles to a Publication With a Subscription
See create subscription command and define subscription command for more information on the two methods of refreshing publication subscriptions. See also validate publication command.