I have an inventory db with a table called items which I am using GUID for the item_id and table_key (auto incrementing) for the primary key. Works just fine. I also have a table called item_history which is a copy of items table including the primary key field. I am using this to be able to recall the items history. Just before I make a change to the item in items table it copies it to the item_history table. If another change is required it again copies (inserts not update) it to item_history.
The problem I have is when I copy the row from items to item_history the second time I get an error about duplicate primary key if I have the primary key turned on in item_history.
My question is does the item_history table need a primary key? Or how do I get around this?
TIA
The problem I have is when I copy the row from items to item_history the second time I get an error about duplicate primary key if I have the primary key turned on in item_history.
My question is does the item_history table need a primary key? Or how do I get around this?
TIA