Replication of Deferred Updates on Primary Keys

Updates to the unique column index in a table is not supported by traditional replication, and the Replication Server reports errors.

The replication of updates to the unique column index in a table is not supported, and Replication Server reports errors. For example, table t has a unique index on column c, with values 1, 2, 3, 4 and 5. A single update statement is applied to the table:

update t set c = c+1

Using traditional replication, this statement results in:

update t set c = 2 where c = 1
update t set c = 3 where c = 2
update t set c = 4 where c = 3
update t set c = 5 where c = 4
update t set c = 6 where c = 5

The first update attempts to insert a value of c=2 into the table. However, this value already exists in the table. Replication Server displays error 2601—an attempt to insert a duplicate key.

The Replication Server DSI stops working if you attempt to replicate updates to a non-Sybase table that has a unique column index. To work around this problem, broaden the unique index definition.