SQL插入到带有2个非唯一主键的表中

 收藏

我有一个表,我需要在其中插入数据。

The table Sales has 4 columns CustomerValueType_id (int), Customer_id (int), Value (NVARCHAR), Customer_name (NVARCHAR).

The CustomerValueType_id (int), Customer_id (int) are foreign keys that are not-unique, CustomerValueType_id matches to a value type, while Customer_id matches to the Customer_name

I need to add additional customer data into the Valuecolumn but how do I ensure that the data matches to the correct CustomerValueType_id and Customer_id and each customer name has to be repeated in the Customer_name

回复