-2
我使用MERGE
到UPDATE
或INSERT
數據到我的數據庫中。但是當我把MERGE
放入我的表JW_MaterialData
或JW_MaterialData2PL
時,我得到FK錯誤,如下所示。MERGE衝突外鍵約束
The MERGE statement conflicted with the FOREIGN KEY constraint
"FK_JW_MaterialData_cMat_Material". The conflict occurred in database
"TEST", table "dbo.cMat_Material", column 'camosGUID'.
和
The MERGE statement conflicted with the FOREIGN KEY constraint
"FK_JW_MaterialData2PL_cMat_MaterialText". The conflict occurred in
database "TEST", table "dbo.JW_MaterialData", column 'camosGUID'.
我已經嘗試了不同的順序MERGE
陳述,但沒有幫助。我首先嚐試cMat_Material
然後小孩。或者先是子女JW_MaterialData2PL
然後JW_MaterialData
然後cMat_Material
。
的依賴是這些: cMat_Material
>JW_MaterialData
>JW_MaterialData2PL
cMat_Material
>cMat_MaterialText
cMat_PriceList
>JW_MaterialData2PL
有沒有人有一個想法,還有什麼我可以做什麼?我有另一個數據庫具有相同的結構,但不是相同的數據,我沒有問題。
MERGE
陳述的正確順序是什麼?也許我做錯了什麼?
你能否提供你的查詢和表格結構? –
請在更新,插入,刪除任何內容之前運行SELECT進行驗證。謝謝。 – Wendy