What might cause the following error when inserting rows in tables that have primary keys defined as IDENTITY (1,1)?
duplicate key row in object 'aa' with unique index 'aa'
I have seen this happen frequently when data has been bulk loaded sometime in the past into a table that has an IDENTITY key. This is especially common when you have a test environment in which some production data was bulk loaded to give some "good test data." To me it means that an identity number has "already been used" as a record key.
Dave
Can you post the table structures? That would help us to see what your problem might be.
If you can post a few statements that cause the duplicates, that would even be better.
|||If you have the property NOT FOR REPLICATION enabled for the identity column.
Merging changes would allow the exact id values to be inserted rather than a new value that would give the error if same id value exists in the participating server.
similarly, if you are trying to insert manually using SET IDENTITY_INSERT table ON...
No comments:
Post a Comment