This dialog allows you to set a primary key on a table for use during transaction-based replications (mirroring or synchronization.) The primary key is for use within Syniti Replicate only. It does not affect any primary key settings in your database. You can either set a primary key for a table that has no key, or you can override a primary key that has been set in the database. When you display a table in the Management Center Object Browser, primary key fields are displayed with a key icon
. Fields in grey denote a primary key that has been set in the database, but not used in Syniti Replicate.
Note
If you choose to set one or more table columns as primary key in Syniti Replicate, it is critical that each record contains a unique value. If the values are not unique for each record, the results of any replication using the table are unpredictable. The primary key columns defined in Syniti Replicate are used to match source and target records based on their values. Syniti Replicate does not enforce primary key constraints internally, and is not able to determine whether a transaction will be applied to multiple records or whether it will generate duplicate values.
Fields
This column displays all fields that are eligible to be a primary key. Fields that are nullable cannot be used as primary keys.
Keys
This column displays fields that are currently set as a primary key.
Select a field and use the arrow keys to move the field between columns.
The left column of the Define Primary Key dialog, there is a list of fields eligible to be primary keys. It does not include any nullable fields. The right column of the dialog shows any primary keys that have already been set. If a primary key is set in the database, it is displayed in the right column of the dialog.
To add a new primary key, select a field name in the left column, then click the right-facing arrow to move the field into the right column of the dialog. You can use any number of fields (to the limit set by the database you are using) to create a primary key, as long as they can uniquely identify any record.
To remove an existing primary key, select the field name in the right column, then click the left-facing arrow to move the field into the left column of the dialog.
When you have set the primary key to your liking, click OK in the Define Primary Key dialog.
The Management Center table display updates to show your new primary key settings. Note that if you have overridden a primary key set in the database, the field is displayed in grey to show the change. In the example below, the primary key set in the database, au_id, is displayed in grey to show that it will not be used as a primary key for replication, and the fields au_lname and au_fname have been set as primary keys.
Opening the Define Primary Key Dialog
In the Management Center Metadata Explorer, select a source or target table.
From the right mouse button menu, choose Set Primary Key.
Related Topics