The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object while creating Alternate Key in Dynamics 365

We might get error while creating Alternate Key as shown below.

The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name ‘dbo.sab_fash_transactionheaderBase’ and the index name ‘ndx_for_entitykey_sab_fash_headername’. The duplicate key value is (0000001414).

The reason was because there was already records created for that entity and had the field (alternate key one) having duplicate values. Deleting the duplicate record allowed us to create the alternate key on that field.

Hope it helps..


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.