Developer forum

Forum » CMS - Standard features » Maintaining Items table on manual import

Maintaining Items table on manual import

Tom-Erik Paulsen
Reply

We have created several imports to item tables. One thing we are struggeling with is the maintaining of an autoincrement key. The import in it self can maintain this. But when the customer adds new item, they are met with an errormessage:
 

Violation of PRIMARY KEY constraint 'PK__ItemType__3214EC075AF96FB1'. Cannot insert duplicate key in object 'dbo.ItemType_Company_Profile'. The duplicate key value is (4).
The statement has been terminated.

What do you suggest we do after an import to maintain a clean table?


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

In the database you have a table called ItemTypeId which has to be updated to avoid numbers to be resused. Alternatively make sure your import uses another number series.

BR Nicolai

Votes for this answer: 1
 
Tom-Erik Paulsen
Reply

Thanks Nicolai!
That solved it ;-)

 

You must be logged in to post in the forum