Contents Index Solving the problem Maintaining the subscription-list column

SQL Remote User's Guide
  SQL Remote Design for Adaptive Server Enterprise
    Sharing rows among several subscriptions
      The Policy example

The publication

The publication for this database can be created by the following set of statements:

//Mark the tables for replication
exec sp_add_remote_table 'SalesRep'
exec sp_add_remote_table 'Policy'
exec sp_add_remote_table 'Customer'
go
// Create an empty publication
exec sp_create_publication 'SalesRepData'
//Add the Sales Rep table to the publication
exec sp_add_article 'SalesRepData', 'SalesRep'
//Add the Policy table to the publication
exec sp_add_article 'SalesRepData', 'Policy', 
      NULL, 'rep_key'
// Add the Customer table to the publication.
// Subscribe by the subscription_list column
// Exclude the subscription_list column
exec sp_add_article 'SalesRepData', 'Customer', 
      NULL, 'subscription_list'
exec sp_add_article_col 'SalesRepData', 'Customer', 'cust_key'
exec sp_add_article_col 'SalesRepData', 'Customer', 'name'
go

Subscriptions to this publication take the following form:

exec sp_subscription 'create',
         'SalesRepData',
         'userID',
         'rep_key'
go

where userID identifies the subscriber, and rep_key is the subscription column, which is the value of the rep_key column in the SalesRep table.


Contents Index Solving the problem Maintaining the subscription-list column