Chapter 8. SQL Remote Design forAdaptive Ser verEnter prise
Subscriptioncolumn SQLRemote for Adaptive Server Anywhere
supportsexpressions other than column names. ForAdaptive Server
Enterprise,the subscription expression must be a column name.
Whento use WHERE
andSUBSCRIBE BY Youshould use a subscription expression when different subscribers to a
publicationare to receive different rows from a table. The subscription
expressionis the most powerful method of partitioning tables.
Creating an article using a WHERE clause
TheWHERE clause is used to exclude a set of rows from all subscriptions to
apublication.
Tocreate an article using a WHERE clause
1. If you have not already done so, mark the table for replication. Youdo
thisby executing the sp_add_remote_table procedure:
sp_add_remote_table table_name
2. Add the table to the publication. Youdo this by executing the
sp_add_articleprocedure: Specifythe column name corresponding to
theWHERE
column
ISNOT NULL clause in the third argument to the
procedure:
sp_add_article publication_name,
table_name,
column_name
Donot specify IS NOT NULL; it is implicit. Specifythe column name
only.
3. If you wish to include only a subset of the columns in the table, specify
thecolumns using the sp_add_article_col procedure. Youmust include
thecolumn specified in your WHERE clause in the article.
Example Thefollowing set of statements create a publication containing a single
article,which includes only those rows of test_table for which column
col_1is not null:
sp_create_publication test_pub
sp_add_remote_table test_table
sp_add_article test_pub, test_table, col_1
go
Creating an article using a subscription column
Thesubscription column is used when rows are to be shared among many
remotedatabases.
145