The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name "dbo.TheName" and the index name "PK_NameHere"

Question: How do you resolve the error that says "The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name "dbo.TheName" and the index name "PK_NameHere". The duplicate key value is (1)".

 

Answer: Right-Click on the Primary Index column while in Table Design, then navigate to "Indexes/Keys" and delete the Index that might be causing the error.
If the above does not work, delete the Column that is causing an issue, save the changes then recreate the Column again and make it a Primary Key. 
Save your changes using "Save All" icon in Tools tab or press Ctrl+Shift +S all at once.


Edit this Article
CREATE UNIQUE INDEX statement terminated .NET 6 published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy