Creating primary articles

Before you can create a primary article, you must create a primary database connection, and create at least one publication in that connection.

Each primary article identifies a primary object (table or stored procedure) that is published for replication. Therefore, the name of a primary article is the name of the primary object it publishes.

When you create a primary article, you have two options for selecting the fields (table columns or stored procedure parameters) to be published in the primary article. You can either publish all the fields, or specify individual fields to be published in the primary article.

NoteYou must suspend the database connection before you create a primary article. See “Suspending and resuming database connections” for more information.

To create a primary article and publish all fields, use sp_addprimaryart and specify only the publication name and the name of the primary article (primary object):

sp_addprimaryart pub_name, pri_art

where pub_name is the name of the publication, and pri_art is the name of the primary article and primary object.

To create a primary article and publish specified fields, use sp_addprimaryart and specify the publication name, the name of the primary article (primary object), and the numbers of the fields to be published:

sp_addprimaryart pub_name, pri_art, "fields"

where pub_name is the name of the publication, pri_art is the name of the primary article and primary object, and fields is a numeric list of the fields to be published.

After you have created a primary article, you can add the primary article to additional publications with the sp_addprimaryart procedure.

To add an existing primary article to a publication, use sp_addprimaryart and specify the publication name and the name of the existing primary article:

sp_addprimaryart pub_name, pri_art

where pub_name is the name of the publication, and pri_art is the name of the existing primary article.

You can add an existing primary article to as many publications as you want.