Identity columns

Identity columns in source tables are handled similarly to columns without the identity property. The value of a source column is retained when mapped to a target identity column.

Target identity columns will use the value provided by the database if you set the initial value of the column in Management Console to Database Default.

When replicating data to or from tables containing identity columns, consider the following:

  • Any column which has the initial value of the mapping set to Database Default is not applied by CDC Replication. CDC Replication skips the column when applying data and the database provides a value.
  • You cannot reference a target identity column that has the initial value set to Database Default in a derived expression. There is no restriction on the source columns in a similar scenario.
  • User exits cannot access the data for any target column that has an initial value set to Database Default in Management Console.
  • isDataAvailable(int) in the CDC Replication API can be used in a user exit to determine if there is data for a specific column. This method will return false for a target column with an initial value set to Database Default in Management Console. An exception is thrown if you attempt to retrieve the value from a column that is mapped to a target identity column.