Contents Index The primary key pool Filling and replenishing the key pool

SQL Remote User's Guide
  SQL Remote Design for Adaptive Server Enterprise
    Ensuring unique primary keys

Replicating the primary key pool


You can either incorporate the key pool into an existing publication, or share it as a separate publication. In this example, we create a separate publication for the primary key pool.

To replicate the primary key pool

  1. Create a publication for the primary key pool data.

    sp_create_publication 'KeyPoolData'
    go
    sp_add_remote_table 'KeyPool'
    go
    sp_add_article 'KeyPoolData', 'KeyPool',
       NULL, 'location'
    go
  2. Create subscriptions for each remote database to the KeyPoolData publication.

    sp_subscription 'create',
       KeyPoolData,
       field_user,
       rep1
    go

    The subscription argument is the location identifier.

In some circumstances it makes sense to add the KeyPool table to an existing publication and use the same argument to subscribe to each publication. Here we keep the location and rep_key values distinct to provide a more general solution.


Contents Index The primary key pool Filling and replenishing the key pool