Query error: there is no matching unique or primary key constraint in the referenced table
The error message is clear, you are trying to incorporate a FOREIGN KEY on table comm_Customer that says that the CustomerID (which is it's primary key) is also related to table's comm_ShoppingCart CustomerID column. This would mean that every customer might have a shopping cart (but only 1), since CustomerID has to be a primary key (or unique) on the comm_ShoppingCart to correctly identify a unique row of that table with the foreign key relationship.

I believe the relationship is the other way arround, comm_ShoppingCart CustomerID should reference table's comm_Customer CustomerID which IS a primary key and won't display this error message.

If this is the case, you can add the FOREIGN KEY with an ALTER TABLE if it's already created:

ALTER TABLE comm_ShoppingCart 
    ADD CONSTRAINT FK_comm_ShoppingCart_comm_Customer 
    FOREIGN KEY (CustomerID) 
    REFERENCES comm_Customer (CustomerID)


If you really want the other way around, you have to create a UNIQUE constraint (or index) on CustomerID column on the comm_ShoppingCart table:

ALTER TABLE comm_ShoppingCart
    ADD CONSTRAINT UNI_comm_ShoppingCart_CustomerID
    UNIQUE (CustomerID)


... which will fail if you have more than 1 cart for a particular customer.