SQL-Server与外键冲突 [英] SQL-Server conflicated with the foreignkey

查看:230
本文介绍了SQL-Server与外键冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

INSERT语句与FOREIGN KEY约束"FK_TaxDetails_MasterTable"冲突.在数据库"E:\ 23 \ DEVELOPMENT \ SOURCE \ CERPWEB \ APP_DATA \ ASPNETDB.MDF"的表"dbo.MasterTable"中发生冲突.
该语句已终止

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TaxDetails_MasterTable". The conflict occurred in database "E:\23\DEVELOPMENT\SOURCE\CERPWEB\APP_DATA\ASPNETDB.MDF", table "dbo.MasterTable".
The statement has been terminated

推荐答案

通常,在表上执行INSERT命令并且该表的其中一个列引用另一个表上的主键时,会发生此错误,并且插入到该特定列的值在另一个表中不存在.
看看此-[数据库中发生冲突] [^ ]文章,它将帮助您解决问题.
Generally This error occurs when performing an INSERT command on a table and one of the columns of the table references a primary key on another table and the value being inserted to that particular column does not exist in the other table.
Take a look at this-[The conflict occurred in database Database][^] article it will help you to solve your problem.


这篇关于SQL-Server与外键冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆