Reseed identity values after synchronization
After data synchronization, inserting new records into the synchronized table may result in an error indicating that an automatically generated value violates a primary key or unique constraint.
To automatically reseed identity values after synchronization, select the checkbox for Reseed identity columns when configuring synchronization options in the Data Synchronization Wizard. dbForge Studio will take the current identity value from the source table and apply it to the target table. This ensures that identity columns with a primary key constraint continue generating valid identity values.
Limitations
There are certain situations where the current identity value in the target database may become invalid or remain out of sync.
- Data changes before or during synchronization: Data may have been modified either before synchronization or concurrently with the data comparison.
- Synchronization direction changed: If the synchronization direction is reversed, the data sources must be compared again, as the identity value is captured at registration time.
- No detected differences: If no differences are found in a table, dbForge Studio does not reseed the identity values, which can result in discrepancies.
- Records deleted using a DELETE statement: When records are deleted from the source table, the identity value is not rolled back. As a result, dbForge Studio synchronizes the current (and possibly higher-than-expected) identity value. To reset the identity value, use the
TRUNCATE TABLE command to roll it back to its base seed value.