General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Always use a surrogate primary key - one that has no meaning attached to it. Use the auto inc or SYS(2015) to generate one.
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only