テーブル(製品)の列(ProductID(FK)とProductType(FK))を更新しようとしています。これらの2つの列は、MProductテーブルの列MProductID(PK)およびMProductType(PK)と関係があります。
更新しようとしています
ProductID ProductType
9999 11
9999 12
しかし、私は次のエラーが発生しました
The UPDATE statement conflicted with the FOREIGN KEY constraint "FKHCR_MProduct".
The conflict occurred in database "XXXX", table "dbo.MProduct".
MProductテーブルで確認しました。検索用の有効なレコードがすべて含まれています。テーブル構造を変更できません。
私もこのクエリを試しました
Select ProductID,ProductType
from dbo.Product P
Left Join dbo.MProduct M on M.ProductID = P.ProductID
and M.ProductType = P.ProductType
where M.ProductType is null
and M.ProductID is null
出力がないということは、ルックアップテーブル内にヌルデータがないことを意味します。