The INSERT statement conflicted with the FOREIGN KEY constraint. The conflict occurred in database

前端 未结 2 368
旧时难觅i
旧时难觅i 2021-01-13 06:33

I have been having this problem for a couple of hours now. In SQL Server, I ran this query :

INSERT INTO USERS_AVATAR(userId, avatId) VALUES (\'         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 07:24

    Before inserting userIds 1 and 2 into USERS_AVATAR, you must first insert them into table USERS. That is what the FOREIGN KEY constraint is requiring.

提交回复
热议问题