<bdo id='wnwVw'></bdo><ul id='wnwVw'></ul>
  • <small id='wnwVw'></small><noframes id='wnwVw'>

    <legend id='wnwVw'><style id='wnwVw'><dir id='wnwVw'><q id='wnwVw'></q></dir></style></legend>
    <i id='wnwVw'><tr id='wnwVw'><dt id='wnwVw'><q id='wnwVw'><span id='wnwVw'><b id='wnwVw'><form id='wnwVw'><ins id='wnwVw'></ins><ul id='wnwVw'></ul><sub id='wnwVw'></sub></form><legend id='wnwVw'></legend><bdo id='wnwVw'><pre id='wnwVw'><center id='wnwVw'></center></pre></bdo></b><th id='wnwVw'></th></span></q></dt></tr></i><div id='wnwVw'><tfoot id='wnwVw'></tfoot><dl id='wnwVw'><fieldset id='wnwVw'></fieldset></dl></div>

    1. <tfoot id='wnwVw'></tfoot>
      1. INSERT 语句与 FOREIGN KEY 约束冲突

        时间:2023-10-09
            <tbody id='wrhfk'></tbody>

        • <i id='wrhfk'><tr id='wrhfk'><dt id='wrhfk'><q id='wrhfk'><span id='wrhfk'><b id='wrhfk'><form id='wrhfk'><ins id='wrhfk'></ins><ul id='wrhfk'></ul><sub id='wrhfk'></sub></form><legend id='wrhfk'></legend><bdo id='wrhfk'><pre id='wrhfk'><center id='wrhfk'></center></pre></bdo></b><th id='wrhfk'></th></span></q></dt></tr></i><div id='wrhfk'><tfoot id='wrhfk'></tfoot><dl id='wrhfk'><fieldset id='wrhfk'></fieldset></dl></div>

          <tfoot id='wrhfk'></tfoot>
            1. <small id='wrhfk'></small><noframes id='wrhfk'>

                  <bdo id='wrhfk'></bdo><ul id='wrhfk'></ul>

                • <legend id='wrhfk'><style id='wrhfk'><dir id='wrhfk'><q id='wrhfk'></q></dir></style></legend>
                  本文介绍了INSERT 语句与 FOREIGN KEY 约束冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  错误:System.Data.SqlClient.SqlException:INSERT 语句与 FOREIGN KEY 约束FK__Item__order__3AE27131"冲突.冲突发生在数据库pmall"、表dbo.ItemSaved"、列id"中.

                  Error: System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK__Item__order__3AE27131". The conflict occurred in database "pmall", table "dbo.ItemSaved", column 'id'.

                  这是我的桌子:

                  • id
                  • ItemID(在此表中设置为 Item.id 的 FK)
                  • ...等

                  这是我的插入语句:

                  insert into ItemSavedUnits (ItemID, name, Price)
                  select ItemID, name,Price
                  from ItemUnits where ItemID = 92439 
                  

                  我真的不明白为什么如果我对与 Item.ItemID 和 ItemUnits 相关的 ItemSavedUnits.ItemID 的 FK 约束根本没有约束,为什么我在插入 ItemSavedUnits 时遇到问题.我尝试插入的 ItemID 确实存在于 Item 表中.

                  I don't really understand why if I a FK constraint on ItemSavedUnits.ItemID that is related to Item.ItemID and ItemUnits has no constraints at all why I'm getting a problem inserting into ItemSavedUnits. The ItemID I'm tryign to insert does exist in the Item table.

                  推荐答案

                  您确定 ItemId 92439 存在于 Item 表中,而不仅仅是 ItemUnits 中吗?

                  Are you absolutely sure that ItemId 92439 exists in the Item table, and not just in ItemUnits?

                  您的 select 语句是否返回 null?

                  Is your select statement returning null?

                  这篇关于INSERT 语句与 FOREIGN KEY 约束冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:尝试从 Select 创建表 - SQL Server 2008 抛出错误 下一篇:CHECKSUM 和 CHECKSUM_AGG:算法是什么?

                  相关文章

                  • <bdo id='WdJbU'></bdo><ul id='WdJbU'></ul>

                • <legend id='WdJbU'><style id='WdJbU'><dir id='WdJbU'><q id='WdJbU'></q></dir></style></legend>

                • <i id='WdJbU'><tr id='WdJbU'><dt id='WdJbU'><q id='WdJbU'><span id='WdJbU'><b id='WdJbU'><form id='WdJbU'><ins id='WdJbU'></ins><ul id='WdJbU'></ul><sub id='WdJbU'></sub></form><legend id='WdJbU'></legend><bdo id='WdJbU'><pre id='WdJbU'><center id='WdJbU'></center></pre></bdo></b><th id='WdJbU'></th></span></q></dt></tr></i><div id='WdJbU'><tfoot id='WdJbU'></tfoot><dl id='WdJbU'><fieldset id='WdJbU'></fieldset></dl></div>

                    <small id='WdJbU'></small><noframes id='WdJbU'>

                      <tfoot id='WdJbU'></tfoot>