2601: Cannot insert duplicate key row in object with unique index. The duplicate key value is ...
SQL ServerWhat does it mean?
A UNIQUE INDEX rejected a row because of a duplicate key value. 2627 is raised for constraints, 2601 for unique indexes.
Why does it happen?
Writing an existing value again into column(s) protected by a UNIQUE INDEX, concurrent inserts, or a collision among rows covered by a filtered unique index.
How to fix it
Remove or update the duplicate value. If duplicates must be tolerated, consider the IGNORE_DUP_KEY = ON option (duplicates are silently skipped). Add a NOT EXISTS check before inserting. If there is a filtered index, verify its WHERE clause and the collision.
More from this engine
- 1205Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim
- 2627Violation of PRIMARY KEY / UNIQUE KEY constraint. Cannot insert duplicate key in object
- 547The INSERT/UPDATE/DELETE statement conflicted with the FOREIGN KEY / CHECK constraint
- 18456Login failed for user
- 8152String or binary data would be truncated
- 2628String or binary data would be truncated in table, column ...; truncated value