create article

Creates an article for a table or function replication definition and specifies the publication that is to contain the article.

Syntax

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]...]...]

Parameters

Examples

Usage

  • 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

  • Before executing create article, make sure that:
    • The publication for which you are creating the article already exists.

    • The replication definition for the article already exists.

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

  • If you add a new article to an existing publication, or drop an article from the publication, the publication is invalidated. Although replication for existing articles continues unaffected, in order to begin replication for the new articles you must:
    • Validate the publication when you finish making changes to the publication, then

    • Refresh the publication 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.

Permissions

create article requires “create object” permission.

Related reference
check publication
create applied function replication definition
create publication
create replication definition
create request function replication definition
create subscription
define subscription
drop article
drop publication
validate publication