When Source and Destination Tables Have Different Names

When the source table and any destination tables have different names, use with primary table named to specify the name of the source table, or use with replicate table named to specify the destination table name.

You can use one of these clauses or both of them together.

If you do not specify different table names, the replication definition name is assumed by Replication Server to be the name of both the source and destination tables.

For example, to create a replication definition named publishers_rep for a source table named publishers1 and destination tables named publishers2, enter:
create replication definition publishers_rep
with primary at TOKYO_DS.pubs2
with primary table named publishers1
with replicate table named publishers2
...
For a replication definition and a source table named publishers, and destination tables named publishers2, enter:
create replication definition publishers
with primary at TOKYO_DS.pubs2
with replicate table named publishers2
...

In this example, the publishers replication definition also becomes the source table’s name.