"ShoppingCartMigrate" Stored Procedure

Description:

This stored procedure migrates entries from a temporary shopping cart to a new CartID.  It is called on the component layer when a customer logs in or registers.

Definition:

    CREATE Procedure ShoppingCartMigrate
    (
        @OriginalCartId nvarchar(50),
        @NewCartId      nvarchar(50)
    )
    AS

    UPDATE
        ShoppingCart

    SET
        CartId = @NewCartId

    WHERE
        CartId = @OriginalCartId
        
Database Tables Used:

ShoppingCart:   The ShoppingCart table keeps track of the items a user has purchased.  Its primary key is the RecordID field.  The CartID is a string which we use to identify the user currently logged in.  There is a many to one relationship between the ShoppingCart table and the Products table.  Note that if not Quantity is supplied, a default of 1 is entered.