下载数据提示dbo.POS_FoodCombine 中插入重复键

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-23浏览:1

下载数据提示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 中插入重复键

问题描述:下载数据提示dbo.POS_FoodCombine 中插入重复键解决方案:在cloud数据库执行脚本select * from ( select FShopID,FoGNo,F...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息