Developer forum

Forum » Swift » Error Duplicate key

Error Duplicate key

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hello,

I have done some data imports on a clean swift install (on 9.12).

When I stopped working yesterday evening the website still worked, but overnight something has changed resulting in an error.

Any idea where I need to look and fix this?


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Justin

Can you check if you happen to have duplicate product entry with the same value in [ProductID] and [ProductLanguageID] and where variantid = null or emptystring.

It seems like you have a duplicate product somehow...!

BR Nicolai

Votes for this answer: 1
 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hey Nicolai,

Thx, that was indeed causing this error. Now for the big search on which data has caused this, but I can move ahead after excuting this query, and can find out which product I'm missing now.

DELETE FROM [EcomProducts]
WHERE ProductNumber IN
(
SELECT [ProductNumber]
FROM  [EcomProducts]
GROUP BY [ProductNumber]
HAVING COUNT(*) > 1
)

Thanks for your quick reply!

Justin

 

You must be logged in to post in the forum