DBAtlas · Database operations atlas

2601: Cannot insert duplicate key row in object with unique index. The duplicate key value is ...

SQL Server

What 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.

Open in DBAtlas →

More from this engine