SQL Server error code
SQL Server error 1505
SQL Server raises error 1505 at severity 16, which marks a problem with the query or data that you can correct.
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name '%.*ls' and the index name '%.*ls'. The duplicate key value is %ls.
| Msg | 1505 |
|---|---|
| Name | DUP_KEY |
| Severity | 16 |
| Group | 1000–1999 |
What it means
This error occurs when you attempt to create a unique index and more than one row in the table contains the specified duplicate value. A unique index is created when you create an index and specify the UNIQUE keyword, or when you create a UNIQUE constraint. The table cannot contain any rows that have duplicate values in the columns defined in the index or constraint.