下载数据提示dbo.POS_FoodCombine 中插入重复键
问题描述:
下载数据提示dbo.POS_FoodCombine 中插入重复键
解决方案:
在cloud数据库执行脚本
select * from
(
select FShopID,FoGNo,FoodID from
(
SELECT TOP (10000) convert(bigint,A.FRowVersion) [RowVersion], A.FoodID ,HAC.FNUMBER FoGNo ,A.QTY ,A.Amt ,A.MUTEXGROUP ,cast(A.ISSELECT as bit) ISSELECT ,HA.FUSEORGID FShopID ,HA.FMODIFYDATE ,A.FENTRYID ,1 FSwitchFlag
FROM POS_FoodCombine A INNER JOIN POS_FoodDEF HA on HA.FoodID=A.FoodID INNER JOIN POS_FoodDEF HAC on A.FOGNO=HAC.FoodID
WHERE A.FRowVersion > 0)T group by FShopID,FoGNo,FoodID having(count(1))>1
)T inner join POS_FOODDEF_L t1 on t.FOODID=t1.FOODID
inner join T_ORG_ORGANIZATIONS_L tog on t.FShopID=tog.FORGID
delete POS_FoodCombine from
(
select FShopID,FoGNo,FoodID from
(
SELECT TOP (10000) convert(bigint,A.FRowVersion) [RowVersion], A.FoodID ,HAC.FNUMBER FoGNo ,A.QTY ,A.Amt ,A.MUTEXGROUP ,cast(A.ISSELECT as bit) ISSELECT ,HA.FUSEORGID FShopID ,HA.FMODIFYDATE ,A.FENTRYID ,1 FSwitchFlag
FROM POS_FoodCombine A INNER JOIN POS_FoodDEF HA on HA.FoodID=A.FoodID INNER JOIN POS_FoodDEF HAC on A.FOGNO=HAC.FoodID
WHERE A.FRowVersion > 0)T group by FShopID,FoGNo,FoodID having(count(1))>1
)T inner join POS_FOODDEF_L t1 on t.FOODID=t1.FOODID
inner join T_ORG_ORGANIZATIONS_L tog on t.FShopID=tog.FORGID
inner join POS_FoodCombine B ON t.FOODID = B.FOODID and B.FMasterId = 0
下载数据提示dbo.POS_FoodCombine 中插入重复键
本文2024-09-23 04:23:41发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-165021.html