Unable to create index.

Troubleshooting SQL Server

Troubleshooting

Unable to create index.

Appears when a new index has failed on existing data.

ODBC error text

[Microsoft][ODBC SQL Server Driver][SQL Server]Create unique index aborted on duplicate key. Primary key is '[primary key data]'

[Microsoft][ODBC SQL Server Driver][SQL Server]Unable to create constraint. See previous errors.

Explanation

A unique index was created in the Indexes/Keys property page but duplicate data exists in the database. The value after the phrase "Primary key is" is the first duplicate value that Microsoft® SQL Server™ found as it created the index.

Action
  • Remove duplicate data from the database (for example, by using SQL Server Enterprise Manager).

  • Change the option in the Indexes/Keys property page to allow duplicate rows in the index.

See Also

Creating SQL Server Indexes

Indexes

UNIQUE Constraints