Columns with database defaults

Columns having a database default value in the target database can either be overwritten with values coming from the source table or be set to have the initial value of Database Default in Management Console.

CDC Replication skips any column that is set to the initial value of Database Default when applying data on target. The column must be nullable or have a database default value defined in the target database, otherwise SQL exceptions may occur when CDC Replication applies data on the target.

When replicating data to tables containing columns having database defaults, consider the following:

  • All supported data types are supported with database defaults.
  • If you map a source column to a target column containing a database default, the source value will be inserted in the target column.
  • You cannot reference target Database Default columns from the target in a derived expression.
  • 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 database default column.