Using the create replication definition command

Use create replication definition to describe characteristics to Replication Server of a table you want to replicate.

Execute create replication definition at the Replication Server that manages the source table database, or you can execute the rs_send_repserver_cmd stored procedure with the create replication definition clause at the primary database. See “Executing replication definition change requests directly at the primary database”.

A replication definition must include the name of the source data server and database.

The following example creates a basic replication definition named publishers for source and destination tables with the same name. The primary database is pubs2 managed by the TOKYO_DS data server. All of the table’s columns are included and the pub_id column is specified as the primary key.

create replication definition publishers
with primary at TOKYO_DS.pubs2
(pub_id char(4), pub_name varchar(40),
city varchar(20), state char(2))
primary key (pub_id)

Each part of the command is discussed in the following subsections. See create replication definition in Chapter 3, “Replication Server Commands” in the Replication Server Reference Manual for complete command syntax and usage guidelines.