Data Replication with SQL Remote
PART 4. Reference
CHAPTER 18. Command Reference for Adaptive Server Enterprise
To add an article to a publication.
sp_add_article publication_name, table_name, where_expr, subscribe_by_expr
Argument |
Description |
---|---|
publication_name |
The name of the publication to which the article is to be added. |
table_name |
The table containing the article. |
where_expr |
This optional argument must be a column name or NULL. The publication includes only rows for which the supplied column value is not NULL. The default value is NULL, in which case no rows are excluded from the publication.. |
subscribe_by_expr |
The new subscription expression defining which rows are to be included in the publication for each subscription. The expression must be the name of a column in table_name. The default value is NULL. |
sp_create_publication procedure
Running sp_add_article adds an article to a publication. The table must be marked for replication using the sp_add_remote_table procedure before it can be added to a publication; failure to do so leads to an error.
Calling sp_add_article adds all the columns of the table to a publication. If you wish to include only some of the columns of the table in a publication you must first run sp_add_article and then call the sp_add_article_col procedure.
As with other data definition changes, in a production environment this procedure should only be run on a quiet SQL Remote installation.
For more information on the requirements for a quiet system, see Making schema changes.
The following statement adds the SalesRep table to a publication named SalesRepData:
sp_add_article 'SalesRepData', 'SalesRep'