Contents Index Create the necessary users and permissions Extract the remote database

SQL Remote User's Guide
  A Tutorial for Adaptive Server Enterprise Users
    Tutorial: Adaptive Server Enterprise replication
      Setting up the consolidated database

Create the publication and subscription

The remaining task is to define the data to be replicated. To do this, you must first create a publication, which defines the available data, and then create a subscription for field_user, which defines the data that user is sharing.

In Adaptive Server Enterprise, they are created with the sp_create_publication procedure, which creates an empty publication, and the sp_add_article procedure, which adds articles to the procedure. Also, each table must be marked for replication before it can be included in a publication.

To create the publication

  1. Create an empty publication:

    exec sp_create_publication SalesRepData
    go
  2. Mark both the SalesRep table and the Customer table for publication:

    exec sp_add_remote_table SalesRep
    go
    exec sp_add_remote_table Customer
    go
  3. Add the whole SalesRep table to the SalesRepData publication:

    exec sp_add_article SalesRepData, SalesRep
    go
  4. Add the Customer table to the SalesRepData publication, using the rep_key column to partition the table. The following statement should be typed all on one line, except for the go:

    exec sp_add_article SalesRepData, Customer, NULL, 'rep_key'
    go
Add a subscription 

Each user ID that is to receive changes to a publication must have a subscription to that publication. Subscriptions can only be created for a valid remote user. You need to add a subscription to the SalesRepData publication for the remote database user field_user.

To create a subscription


Contents Index Create the necessary users and permissions Extract the remote database