INSERT statement conflicted with the FOREIGN KEY constraint - SQL Server

前端 未结 14 1258
-上瘾入骨i
-上瘾入骨i 2020-11-22 11:09

I am getting the following error. Could you please help me?

Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN

14条回答
  •  时光取名叫无心
    2020-11-22 11:57

    The problem is not with client_id from what I can see. It looks more like the problem is with the 4th column, sup_item_cat_id

    I would run

    sp_helpconstraint sup_item
    

    and pay attention to the constraint_keys column returned for the foreign key FK_Sup_Item_Sup_Item_Cat to confirm which column is the actual problem, but I am pretty sure it is not the one you are trying to fix. Besides '123123' looks suspect as well.

提交回复
热议问题