问题现象: |
在结转上年购销存时,画面停留在存货价格表,提示销售系统结转失败,用事件查看器观察,在执行如下语句时提示错误INSERT 语句与 FOREIGN KEY 约束"FK_InvUPrice_Inventory"冲突。该冲突发生于数据库"UFDATA_001_2012",表"dbo.Inventory", column 'cInvCode'。
Insert into SA_InvUPrice(cInvCode,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,iUPrice1,iUPrice2,iUPrice3,iInvSCost,iInvSaleCost,cMemo,dStartDate,dEndDate,ISalePrice1,ISalePrice2,ISalePrice3,IUPrice4,ISalePrice4,IUPrice5,ISalePrice5,IUPrice6,ISalePrice6,IUPrice7,ISalePrice7,IUPrice8,ISalePrice8,IUPrice9,ISalePrice9,IUPrice10,ISalePrice10,cDesc) Select cInvCode,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,iUPrice1,iUPrice2,iUPrice3,iInvSCost,iInvSaleCost,cMemo,dStartDate,dEndDate,ISalePrice1,ISalePrice2,ISalePrice3,IUPrice4,ISalePrice4,IUPrice5,ISalePrice5,IUPrice6,ISalePrice6,IUPrice7,ISalePrice7,IUPrice8,ISalePrice8,IUPrice9,ISalePrice9,IUPrice10,ISalePrice10,cDesc From UFDATA_001_2011..SA_InvUPrice
|
原因分析: |
在结转上年购销存时,画面停留在存货价格表,提示销售系统结转失败,用事件查看器观察,在执行如下语句时提示错误INSERT 语句与 FOREIGN KEY 约束"FK_InvUPrice_Inventory"冲突。该冲突发生于数据库"UFDATA_001_2012",表"dbo.Inventory", column 'cInvCode'。
Insert into SA_InvUPrice(cInvCode,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,iUPrice1,iUPrice2,iUPrice3,iInvSCost,iInvSaleCost,cMemo,dStartDate,dEndDate,ISalePrice1,ISalePrice2,ISalePrice3,IUPrice4,ISalePrice4,IUPrice5,ISalePrice5,IUPrice6,ISalePrice6,IUPrice7,ISalePrice7,IUPrice8,ISalePrice8,IUPrice9,ISalePrice9,IUPrice10,ISalePrice10,cDesc) Select cInvCode,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,iUPrice1,iUPrice2,iUPrice3,iInvSCost,iInvSaleCost,cMemo,dStartDate,dEndDate,ISalePrice1,ISalePrice2,ISalePrice3,IUPrice4,ISalePrice4,IUPrice5,ISalePrice5,IUPrice6,ISalePrice6,IUPrice7,ISalePrice7,IUPrice8,ISalePrice8,IUPrice9,ISalePrice9,IUPrice10,ISalePrice10,cDesc From UFDATA_001_2011..SA_InvUPrice
|