发布时间:2025-12-16
特价活动:>>>> 用友U8、T6、T+、T3软件产品4折优惠,畅捷通T+cloud、好会计、好业财、好生意云产品6-8折优惠,另有话费赠送。
你好,我们客户这个新开了个超市,重新建立个账套。现在存货资料里的条形码出了问题,之前11.6的版本时候,条形码默认会对应多计量单位的。现在12.0,默认一品多码,存货在没有做对照码的时候导入了条形码,现在出了问题扫任意条码出来都是单件,整箱的无法带出。现在冲之前账套导出带单位的条码导入,现在需求想把条形码批量的删除一下,五千多条数据单个删除太多了,看能否用脚本一次性把条形码删除。
--执行以下脚本前,先备份数据,测试无误后再在正式账套中执行。
begin tranIF OBJECT_ID('testclasstable', 'U') IS NOT NULLbegin drop table testclasstableend;with temp(id,idparent,code,isEndNode) as (select id,idparent,code,isEndNode from [AA_inventoryClass] where idparent =(select id from [AA_inventoryClass] where code='存货类别的code')union all select t.id,t.idparent,t.code,t.isEndNode from AA_InventoryClass as t inner join temp as c on t.idparent=c.id ) select id,idparent,code,isEndNode into testclasstable from temp where isendnode=1delete from AA_InventoryBarCode where idinventoryDTO in ( select id from AA_Inventory where idinventoryclass in ( select id from testclasstable where isendnode=1) )drop table testclasstablecommit trango
截屏,微信识别二维码
客服QQ:5151867
(点击QQ号复制,添加好友)