I’m trying (SQL Server Compact) to add primary key constraint on existing table that has some rows in it. While adding primary key I’m getting the error:
“A duplicate key cannot be inserted into a unique index”
I don’t what this is, can anyone help me with this?
Try this
If there are any records returned from this above query you cannot add a primary key on
id_columnsince duplicate IDs exist.Of course you will need to replace
id_columnandyour_tablewith the appropriate names.