Inserts into IDENTITY columns for data replication
- Last Updated: July 26, 2021
- 1 minute read
- DataDirect Connectors
- JDBC
- Microsoft SQL Server 6.0
- Documentation
The driver supports inserts into IDENTITY columns for data replication. This functionality might be useful when publishing data from an earlier version of SQL Server. By default, the columns defined as IDENTITY contain auto-generated numbers for new rows inserted. Identity columns might be included as a part of the primary key, therefore, it is important to avoid duplicate values in the these columns. By specifying a value, you can maintain the row identity of the source column in the destination column in SQL Server.
To enable inserts into IDENTITY columns, set the EnableReplicationUser connection property to true (Enabled). When the property is set to true (Enabled), explicit values can be inserted into IDENTITY columns defined as NOT FOR REPLICATION. For inserts to succeed, IDENTITY columns must defined as NOT FOR REPLICATION.