INSERT statement conflicted with the FOREIGN KEY constraint - SQL Server

前端 未结 14 1118
-上瘾入骨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:58

    You are trying to insert a record with a value in the foreign key column that doesn't exist in the foreign table.

    For example: If you have Books and Authors tables where Books has a foreign key constraint on the Authors table and you try to insert a book record for which there is no author record.

提交回复
热议问题