User's Manual
❖ To create an article using a subscription column
1. If you have not already done so, mark the table for replication. You do
this by executing the sp_add_remote_table procedure:
sp_add_remote_table table_name
2. Add the table to the publication. You do this by executing the
sp_add_article procedure: Specify the column name you wish to use as
a subscription expression in the fourth argument to the procedure:
sp_add_article publication_name,
table_name,
NULL,
column_name
You must include the NULL entry to avoid adding a WHERE clause.
3. If you wish to include only a subset of the columns in the table, specify
the columns using the sp_add_article_col procedure. You must include
the column specified in your subscription expression in the article.
Example ♦ The following set of statements create a publication containing a single
article, which supports subscriptions based on the value of column col_1:
sp_create_publication test_pub
sp_add_remote_table test_table
sp_add_article test_pub,
test_table,
NULL,
col_1
go
Notes on articles
♦ You can combine a WHERE clause and a subscription expression in an
article.
♦ All columns in the primary key must be included in any article.
♦ You must not include a subset of columns in an article unless either:
• The remaining columns have default values or allow NULLs.
• No inserts are carried out at remote databases. Updates would not
cause problems as long as they do not change primary key values.
If you include a subset of columns in an article in situations other than
these, INSERT statements at the consolidated database will fail.
146