Hi,<BR><BR>The IBuySpy store alows an anonymous user to put items in a shopping cart.<BR><BR>If the user then logs in, the items are re-identified as belonging to that user&#039;s cart with the following SQL..<BR><BR>CREATE Procedure ShoppingCartMigrate<BR>(<BR> @OriginalCartId nvarchar(50),<BR> @NewCartId nvarchar(50)<BR>)<BR>AS<BR><BR>UPDATE <BR> ShoppingCart<BR> <BR>SET <BR> CartId = @NewCartId <BR> <BR>WHERE <BR> CartId = @OriginalCartId<BR>GO<BR><BR><BR>The problem with this is that if the user already has item number 56 in their cart and one of the re-assigned items in the anonymous cart also is an item with PK of 56, the final user cart will have two instances of the item with PK= 56.<BR><BR>How is it possible to avoid this? What needs to happen is that the quantities of multiple instances of an item need to be added together and then surplus intances need to be deleted.<BR><BR>I&#039;ve seen people solve this buy iterating through the items to add to the user cart and adding each one to the cart individualy however I was wondering if there is a set based method which doesn&#039;t use this cursor based approach.<BR><BR>Thanks,<BR><BR>I.