Replicating the rowversion data type

CDC Replication supports source and target tables that contain the rowverison data type.

The rowverison data type in Microsoft SQL Server cannot be modified externally. If you want to retain the rowverison data type in your source table, map the column in Management Console to a BINARY(8) data type on the target. If you want the source table schema to be identical to the target table schema, set the target column to an initial value of Read Only in Management Console.

When replicating data to tables containing the rowverison data type, consider the following:

  • Replicating the rowversion data type from a source table when mapped to a binary data type on the target has similar restrictions to the replication of BINARY data types
  • When present both in the source and target table, the rowverison data type will contain different values when replicating values for other columns.
  • rowverison data types in the target table are not applied by CDC Replication. CDC Replication skips the column when applying data and the database provides a value.
  • When mapping a column to rowverison on the target, you cannot reference target rowverison columns 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 rowverison columns. There is no restriction on the source columns in a similar scenario.
  • 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 having an initial value set to Read Only. isReadOnly(int) will return true for these columns. An exception is thrown if you attempt to retrieve the value from a column that is mapped to a target rowverison column.