>I have a table called Product with a field called ProductID, and the ProductID is the primary key of the table.
>
>When a user creates a record with ProductID = 'ABC', and then deletes it, and then creates it again, i receive a dup primary key error, because the deleted record still exists as a marked-delete record.
>
>I would like to know how can i create a primary key on ProductID without this problem?
>
>Thanks,
>David Fung
David, the error is created because you have a
candidate index on this key. You can:
1) If you change to
regular index you will be allowed to create multiple records with the same key, deleted or otherwise.
2) You can check for a previously deleted record with the same key and recycle it.
3) Before deleting the record in the first place clear the primary key.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.