DECLARE @SQL VARCHAR(MAX)SELECT @SQL=ISNULL(@SQL,‘‘)+‘ UPDATE ‘+NAME+‘ SET B=3 WHERE B=2‘FROM SYSOBJECTS WHERE TYPE=‘U‘ AND ....--某些条件EXEC(@SQL)
update ck_仓库库存000 set 成本价=isnull(b.标准成本,0),零售价=isnull(b.零售价1,0) from ck_仓库库存000 a,xs_商品档案 b where a.商品编码=b.商品编码
DECLARE @SQL VARCHAR(MAX)
SELECT @SQL=ISNULL(@SQL,‘‘)+‘ UPDATE ‘+NAME+‘ set 成本价=isnull(b.标准成本,0),零售价=isnull(b.零售价1,0) from ‘+name+‘ a,xs_商品档案 b where a.商品编码=b.商品编码‘
FROM SYSOBJECTS WHERE TYPE=‘U‘ AND name like ‘ck_仓库库存%‘--某些条件
EXEC(@SQL)
时间: 2024-12-30 02:52:29