So if the import has the same SKU as an existing product then the import just updates that product - It does not creating another record ?
No, that is working fine - it updates the record with the same SKU - but only the first one though. Just when the initial import has multiple Excel rows with the same SKU it creates duplicates. I looked up the import code and it checks only if the SKU is already in Product table (in that case it updates it). It does not check if the same SKU is in previous rows in Excel and imports it multiple times.
I think that Product table should have unique index on SKU field.
BTW: here is a query which returns Product IDs for the same SKU and in the same Category - real duplicates. Maybe somebody would need that (I had 44 such SKUs from 1,700 total):
STUFF ((SELECT ',' + cast( p.Id as nvarchar)
FROM dbo.Product p
WHERE dbo.Product.Sku = p.Sku
FOR XML PATH('')),1,1,'') as IDs,
dbo.Product.SKU, dbo.Category.Name as CategoryName
FROM dbo.Product INNER JOIN
dbo.Product_Category_Mapping ON dbo.Product.Id = dbo.Product_Category_Mapping.ProductId INNER JOIN
dbo.Category ON dbo.Product_Category_Mapping.CategoryId = dbo.Category.Id
GROUP BY dbo.Product.Sku, dbo.Category.Name
HAVING (COUNT(dbo.Product.Id) > 1)
ORDER BY dbo.Product.Sku