Cannot use index option ignore_dup_key to alter index ‘%.*ls’ as it enforces a primary or unique constraint.

Error Message:Msg 1979, Level 16, State 1, Line 2
Cannot use index option ignore_dup_key to alter index ‘%.*ls’ as it enforces a primary or unique constraint.

Severity level:16.

Description:This error message appears when you try to alter an index to allow duplicate keys, but this index is used to enforce a PRIMARY KEY or UNIQUE constraint, which does not allow duplicates by definition.

Consequences:The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:Error of the Severity level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be run this way. You can not alter an index that is used by SQL Server to enforce uniqueness to allow duplicates.