Chapter 5. A Tutorialfor Adaptive Server Enterprise Users
Youshould create a directory for each of the two users of the replication
systemunder your parent directory for this tutorial:
mkdir c:\tutorial\hq
mkdir c:\tutorial\field
Thenext step is to add a pair of tables to the consolidated database.
Toadd tables to the consolidated database
1. Connect to the hq database from
isql
,as a system administrator.
2. Use the hq database:
use hq
go
3. Create the SalesRep table with the following statement:
create table SalesRep (
rep_key char(12) not null,
name char(40) not null,
primary key (rep_key) )
go
4. Create the Customer table with the following statement:
create table Customer (
cust_key char(12) not null,
name char(40) not null,
rep_key char(12) not null,
primary key (cust_key) )
go
5. Alter the Customer table to add a foreign key to the SalesRep table:
alter table Customer
add foreign key
( rep_key ) references SalesRep
go
Youare now ready for the rest of the tutorial.
Setting up the consolidated database
Thissection of the tutorial describes how to prepare the consolidated
databaseof a simple replication system.
Preparinga consolidated database for replication involves the following
steps:
1. Create a message type to use for replication.
59