执行存储过程总是报 临时表无效
USE [wfp]
GO
/****** Object: StoredProcedure [dbo].[pr_T接口_一代_上下架_网店产品_读取] Script Date: 03/28/2013 19:12:13 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pr_T接口_一代_上下架_网店产品_读取]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[pr_T接口_一代_上下架_网店产品_读取]
GO
USE [wfp]
GO
/****** Object: StoredProcedure [dbo].[pr_T接口_一代_上下架_网店产品_读取] Script Date: 03/28/2013 19:12:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[pr_T接口_一代_上下架_网店产品_读取]
@dbname varchar(20) --数据库名称
,@wfpuser varchar(100) --操作账号
,@shopid varchar(100) --店铺编号
,@shoptype varchar(100) --店铺类型
as
/*
[调用]
exec wfp..[pr_t接口_一代_上下架_网店产品_读取]
@dbname = N'edb_asqldev.',
@wfpuser = N'edb_b000035',
@shopid = N'7',
@shoptype = N'淘宝'
select * from edb_asqldev..wfpuser_a0305
[功能]:读取网店产品数据,用于执行上下架操作
[输入]:店铺信息,详细请参风参数说明
[输出]:用于执行上下架的数据集
[实现逻辑]
1.判断库存计算方式m..
2.判断是否开启预售
3.计算产品库存
4.网店产品关联库存,并分析执行操作,上架还是下架
5.返回上下架结果集
[作者]:
[版本号]:v1.0
[最后修改时间]:2013-3-14
[历史修改记录]:
-------------------
修改人:朱熹-刘津防
修改原因:为了实现数据同步平台自动上下架
修改内容:1.将启用上下架(备用4)重命名为 是否启用上下架
2.是否更新条形码 默认为False
3.添加自动上下架状态读取 (默认更新,启用更新,不启用更新)
-------------------
*/
exec('if object_id('''+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload'') is not null drop table '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload
if object_id('''+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload_d'') is not null drop table '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload_d ')
declare @sqltz nvarchar(max)
set @sqltz='
if object_id(''logs..'+@wfpuser+'wfpuser_a0304库存临时表'') is not null drop table logs..'+@wfpuser+'wfpuser_a0304库存临时表
DECLARE @ac0052 nvarchar(500)
SELECT @ac0052=ac0052
FROM '+@dbname+'.wfpcode_ad0527 a
JOIN '+@dbname+'.wfpuser_a0401 b
ON Charindex('',''+Convert(VARCHAR,b.objorder)+'','','',''+Isnull(a.ac0052,'''')+'','')>0
WHERE a.objname='''+@shopid+''' and a.ad0554='''+case when @shoptype ='分销平台' then '淘宝分销' else @shoptype end+'''
AND Isnull(b.ab0007,0)=0
SELECT @ac0052=Isnull(@ac0052,1)
select a.Objid,(case when isnull(sum(b.TN0010),0)>0 then isnull(sum(b.TN0010),0) else 0 end ) tn0010all
,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.TN0010 else 0 end),0) tn0010
,isnull(SUM(b.ai0018),0) ai0018all,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.ai0018 else 0 end),0) ai0018
,isnull(SUM(b.ti0085),0) ti0085all,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.ti0085 else 0 end),0) ti0085
,isnull(SUM(b.tn0017),0) tn0017all,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.tn0017 else 0 end),0) ti0017
,isnull(max(convert(int,b.ab0041)),0) ab0041
into logs..'+@wfpuser+'wfpuser_a0304库存临时表
from '+@dbname+'.wfpuser_a0304 a
left join '+@dbname+'.wfpuser_a0307 b
on b.kc0001=a.objid
left JOIN '+@dbname+'.wfpuser_a0401 c
ON b.ac0016=c.objorder
WHERE a.objid>0
AND Isnull(c.ab0007,0)=0
GROUP BY a.objid
declare @AllKucunNum int
select @AllKucunNum= isnull((select isnull(objjc,0) from '+@dbname+'.WFPCODE_AD504 where objname=''同步全仓库存''),0)
'
print (@sqltz)
begin
--declare @sql varchar(8000),@upCount varchar(2000)
declare @sql3 nvarchar(max),@sql4 nvarchar(max)
set @sql3='
declare @AllKucunNum int
select @AllKucunNum= isnull((select isnull(objjc,0) from '+@dbname+'.WFPCODE_AD504 where objname=''同步全仓库存''),0)
select b.objid,条形码,商品id,商品数字id,商品属性,产品名称 as 网店产品名称,b.规格 as 规格,是否主产品,子产品存在,b.备用2 as 上次更新数量,
CASE
WHEN a3.objid is null THEN 0
WHEN @allkucunnum=0 THEN
case when a3.ab0041=0 then convert(int,a3.tn0010-a3.ai0018 -a3.ti0085) else a3.ti0017 end
ELSE
case when a3.ab0041=0 then convert(int,a3.tn0010all -a3.ai0018all -a3.ti0085all) else a3.tn0017all end
END AS 图片库存
,c.EC0104 as 品名,
null as 数量,cast (null as varchar(200)) as 网店产品状态,
cast (null as varchar(200)) as 操作结果,''False'' as 选择,
isnull(B.最小下架数量,0) 最小下架数量,isnull(b.上架百分比,100) 上架百分比
,isnull(b.主商家编码,'''') 主商家编码
,b.上架时间 as 上架日期,
null as 下架日期,
a.AM0010 as 软件销售价,
b.销售价格 as 店铺销售价
into '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload
from '+@dbname+'.wfpuser_a0304 a
join '+@dbname+'.wfpuser_a0305 b
on a.ac2037=b.条形码
join '+@dbname+'.wfpuser_a0301 c
on a.AD0506=c.AD0506 and a.AC0011=c.AC0011
left join logs..'+@wfpuser+'wfpuser_a0304库存临时表 a3
on a.objid=a3.objid
where 店铺='''+@shopid+'''
and 店铺类型='''+@shoptype+'''
and isnull(b.备用1,''默认更新'')<>''不启用更新''
and isnull(a.ad0522,''正常'')<>''停用''
and (b.上架时间 is null or getdate()>b.上架时间)
order by 商品id
declare @futureDay int
select @futureDay= isnull((select isnull(objjc,0) from '+@dbname+'.WFPCODE_AD504 where objname=''在途库存上架时间''),0)
-------计算在途库存
if (@futureDay>0 and ('''+@dbname+'''=''edb_a52240.'' or '''+@dbname+'''=''edb_a56043.'' or '''+@dbname+'''=''edb_a47507.''))
begin
select sum(isnull(b.AI0015,0)) as ai0015,c.ac2037 as ac2037 into #在途库存 from '+@dbname+'.wfpuser_a0418 a join '+@dbname+'.wfpuser_a0419 b on
a.AC0025 =b.ac0025
join '+@dbname+'.wfpuser_a0304 c on b.ac0011=c.ac0011 and b.ad0506=c.ad0506 and c.ec0123=b.ec0123
where a.AQ0002 is not null and datediff(day,getdate(),a.aq2050)<@futureDay and datediff(day,getdate(),a.aq2050)>0
and a.AQ2051 is null
group by c.ac2037
update a set 图片库存=图片库存+ai0015 from '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload a join #在途库存 b on a.条形码=b.ac2037
end
'
set @sql4='
---图片库存修改小于0的传0
SELECT a.条形码,a.主商家编码,a.商品id,a.商品数字id,a.商品属性,a.网店产品名称,a.规格,a.是否主产品,a.子产品存在,a.上次更新数量,Convert(INT,CASE
WHEN dbo.fun_defaultv(b.最小下架数量,''[0,]'',0)<floor(dbo.fun_minv(DEFAULT,dbo.fun_defaultv(预上架数,''(0,]'',null),dbo.fun_defaultv(图片库存,''[0,]'',0)* dbo.fun_defaultv(Isnull(b.上架百分比,100),''[0,100]'',100)/100.0))THEN floor(dbo.fun_minv(DEFAULT,dbo.fun_defaultv(预上架数,''(0,]'',null),dbo.fun_defaultv(图片库存,''[0,]'',0)* dbo.fun_defaultv(Isnull(b.上架百分比,100),''[0,100]'',100)/100.0))
ELSE 0
END)图片库存,CASE
WHEN 图片库存>0
AND Isnull(A.最小下架数量,0)<=图片库存 THEN ''可以上架''
ELSE ''下架''
END AS 状态比较,CASE
WHEN 图片库存>0
AND Isnull(A.最小下架数量,0)<=图片库存 THEN ''可以上架''
ELSE ''下架''
END AS 操作类型,CASE
WHEN Isnull(备用4,0)=1 THEN ''1''
ELSE ''0''
END AS 启用上下架,Isnull(A.最小下架数量,0)最小下架数量,100 上架百分比,数量 AS 网店数量,Isnull(b.预上架数,0)预上架数,Isnull(a.图片库存,0)可用图片库存,Isnull(b.上架百分比,100)设置上架百分比,网店产品状态,操作结果,选择,0 AS [check],b.objid oid
,品名,上架日期,下架日期,b.备用1 as 自动上下架状态,''False'' as 是否更新条形码,
a.店铺销售价,a.软件销售价,b.存在状态
INTO #gg
FROM '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload a
JOIN '+@dbname+'.wfpuser_a0305 b
ON a.objid=b.objid
AND(a.图片库存 <>Isnull(b.备用2,0)
OR Isnull(b.备用1,''默认更新'')=''启用更新''
OR(Isnull(A.最小下架数量,0)>图片库存
AND Isnull(上次更新操作,''可以上架'')=''可以上架'')
OR(Isnull(A.最小下架数量,0)<=图片库存
AND Isnull(上次更新操作,''下架'')=''下架''))
WHERE b.店铺类型='''+@shoptype+'''
AND b.店铺='''+@shopid+''' and isnull(b.存在状态,'''')=''''
select 选择,启用上下架 as 是否启用上下架,自动上下架状态,品名,条形码,商品id,商品数字id,商品属性,网店产品名称,主商家编码 as 主商家编号,
规格 as 规格, cast(是否主产品 as bit) 是否主产品,子产品存在,预上架数 as 网店数量,网店产品状态,上次更新数量,CASE
WHEN 图片库存<=0 THEN ''下架''
ELSE ''可以上架''
END 状态比较,
CASE
WHEN 图片库存<=0 THEN ''下架''
ELSE ''可以上架''
END 操作类型,
操作结果,最小下架数量,上架百分比,Convert(INT,图片库存)图片库存,
Convert(INT,图片库存) as 原图片库存,
上架日期,
下架日期,
是否更新条形码,
店铺销售价,
软件销售价,
存在状态
from #gg
'
exec pr_写系统日志 '图片库存计算开始','自动上下架',@shopid,@wfpuser,@dbname
exec pr_更新网店拍下库存 @dbname
exec pr_写系统日志 '图片库存计算结束','自动上下架','ab',@wfpuser,@dbname
EXEC sp_executesql @sqltz
SET @sql3=@sql3+@sql4
EXEC sp_executesql @sql3
print(@sql3+@sql4)
return;
end
GO
[2013/11/4 19:59:37]2013-11-04 19:59:37请求:wfp..pr_T接口_一代_上下架_网店产品_读取方法:,@dbname:edb_a00001.@wfpuser:edb_a00001@shopid:101@shoptype:淘宝结果:对象名 'logs..edb_a00001wfpuser_a0304库存临时表' 无效。 临时表无效
[解决办法]
如果用临时表,也有问题,由于#开头的这种临时表,如果你是通过exec来动态创建的话,后面就不能引用这个#开头的临时表,所以你得把动态创建的语句改成静态的。
这样吧,把语句改一下,改成表的名称是变化的,比如 logs..edb_a00001wfpuser_a0304
给在加上一个字符串,让他每次执行存储过程时,都生成不一样的表名:
USE [wfp]
GO
/****** Object: StoredProcedure [dbo].[pr_T接口_一代_上下架_网店产品_读取] Script Date: 03/28/2013 19:12:13 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pr_T接口_一代_上下架_网店产品_读取]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[pr_T接口_一代_上下架_网店产品_读取]
GO
USE [wfp]
GO
/****** Object: StoredProcedure [dbo].[pr_T接口_一代_上下架_网店产品_读取] Script Date: 03/28/2013 19:12:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[pr_T接口_一代_上下架_网店产品_读取]
@dbname varchar(20) --数据库名称
,@wfpuser varchar(100) --操作账号
,@shopid varchar(100) --店铺编号
,@shoptype varchar(100) --店铺类型
as
/*
[调用]
exec wfp..[pr_t接口_一代_上下架_网店产品_读取]
@dbname = N'edb_asqldev.',
@wfpuser = N'edb_b000035',
@shopid = N'7',
@shoptype = N'淘宝'
select * from edb_asqldev..wfpuser_a0305
[功能]:读取网店产品数据,用于执行上下架操作
[输入]:店铺信息,详细请参风参数说明
[输出]:用于执行上下架的数据集
[实现逻辑]
1.判断库存计算方式m..
2.判断是否开启预售
3.计算产品库存
4.网店产品关联库存,并分析执行操作,上架还是下架
5.返回上下架结果集
[作者]:
[版本号]:v1.0
[最后修改时间]:2013-3-14
[历史修改记录]:
-------------------
修改人:朱熹-刘津防
修改原因:为了实现数据同步平台自动上下架
修改内容:1.将启用上下架(备用4)重命名为 是否启用上下架
2.是否更新条形码 默认为False
3.添加自动上下架状态读取 (默认更新,启用更新,不启用更新)
-------------------
*/
--修改@wfpuser的值,加上时间
set @wfpuser= @wfpuser +replace(convert(varchar(30),getdate(),114),':','_');
exec('if object_id('''+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload'') is not null drop table '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload
if object_id('''+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload_d'') is not null drop table '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload_d ')
declare @sqltz nvarchar(max)
set @sqltz='
if object_id(''logs..'+@wfpuser+'wfpuser_a0304库存临时表'') is not null drop table logs..'+@wfpuser+'wfpuser_a0304库存临时表
DECLARE @ac0052 nvarchar(500)
SELECT @ac0052=ac0052
FROM '+@dbname+'.wfpcode_ad0527 a
JOIN '+@dbname+'.wfpuser_a0401 b
ON Charindex('',''+Convert(VARCHAR,b.objorder)+'','','',''+Isnull(a.ac0052,'''')+'','')>0
WHERE a.objname='''+@shopid+''' and a.ad0554='''+case when @shoptype ='分销平台' then '淘宝分销' else @shoptype end+'''
AND Isnull(b.ab0007,0)=0
SELECT @ac0052=Isnull(@ac0052,1)
select a.Objid,(case when isnull(sum(b.TN0010),0)>0 then isnull(sum(b.TN0010),0) else 0 end ) tn0010all
,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.TN0010 else 0 end),0) tn0010
,isnull(SUM(b.ai0018),0) ai0018all,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.ai0018 else 0 end),0) ai0018
,isnull(SUM(b.ti0085),0) ti0085all,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.ti0085 else 0 end),0) ti0085
,isnull(SUM(b.tn0017),0) tn0017all,isnull(SUM(case when Charindex('',''+b.ac0016+'','','',''+@ac0052+'','')>0 then b.tn0017 else 0 end),0) ti0017
,isnull(max(convert(int,b.ab0041)),0) ab0041
into logs..'+@wfpuser+'wfpuser_a0304库存临时表
from '+@dbname+'.wfpuser_a0304 a
left join '+@dbname+'.wfpuser_a0307 b
on b.kc0001=a.objid
left JOIN '+@dbname+'.wfpuser_a0401 c
ON b.ac0016=c.objorder
WHERE a.objid>0
AND Isnull(c.ab0007,0)=0
GROUP BY a.objid
declare @AllKucunNum int
select @AllKucunNum= isnull((select isnull(objjc,0) from '+@dbname+'.WFPCODE_AD504 where objname=''同步全仓库存''),0)
'
print (@sqltz)
begin
--declare @sql varchar(8000),@upCount varchar(2000)
declare @sql3 nvarchar(max),@sql4 nvarchar(max)
set @sql3='
declare @AllKucunNum int
select @AllKucunNum= isnull((select isnull(objjc,0) from '+@dbname+'.WFPCODE_AD504 where objname=''同步全仓库存''),0)
select b.objid,条形码,商品id,商品数字id,商品属性,产品名称 as 网店产品名称,b.规格 as 规格,是否主产品,子产品存在,b.备用2 as 上次更新数量,
CASE
WHEN a3.objid is null THEN 0
WHEN @allkucunnum=0 THEN
case when a3.ab0041=0 then convert(int,a3.tn0010-a3.ai0018 -a3.ti0085) else a3.ti0017 end
ELSE
case when a3.ab0041=0 then convert(int,a3.tn0010all -a3.ai0018all -a3.ti0085all) else a3.tn0017all end
END AS 图片库存
,c.EC0104 as 品名,
null as 数量,cast (null as varchar(200)) as 网店产品状态,
cast (null as varchar(200)) as 操作结果,''False'' as 选择,
isnull(B.最小下架数量,0) 最小下架数量,isnull(b.上架百分比,100) 上架百分比
,isnull(b.主商家编码,'''') 主商家编码
,b.上架时间 as 上架日期,
null as 下架日期,
a.AM0010 as 软件销售价,
b.销售价格 as 店铺销售价
into '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload
from '+@dbname+'.wfpuser_a0304 a
join '+@dbname+'.wfpuser_a0305 b
on a.ac2037=b.条形码
join '+@dbname+'.wfpuser_a0301 c
on a.AD0506=c.AD0506 and a.AC0011=c.AC0011
left join logs..'+@wfpuser+'wfpuser_a0304库存临时表 a3
on a.objid=a3.objid
where 店铺='''+@shopid+'''
and 店铺类型='''+@shoptype+'''
and isnull(b.备用1,''默认更新'')<>''不启用更新''
and isnull(a.ad0522,''正常'')<>''停用''
and (b.上架时间 is null or getdate()>b.上架时间)
order by 商品id
declare @futureDay int
select @futureDay= isnull((select isnull(objjc,0) from '+@dbname+'.WFPCODE_AD504 where objname=''在途库存上架时间''),0)
-------计算在途库存
if (@futureDay>0 and ('''+@dbname+'''=''edb_a52240.'' or '''+@dbname+'''=''edb_a56043.'' or '''+@dbname+'''=''edb_a47507.''))
begin
select sum(isnull(b.AI0015,0)) as ai0015,c.ac2037 as ac2037 into #在途库存 from '+@dbname+'.wfpuser_a0418 a join '+@dbname+'.wfpuser_a0419 b on
a.AC0025 =b.ac0025
join '+@dbname+'.wfpuser_a0304 c on b.ac0011=c.ac0011 and b.ad0506=c.ad0506 and c.ec0123=b.ec0123
where a.AQ0002 is not null and datediff(day,getdate(),a.aq2050)<@futureDay and datediff(day,getdate(),a.aq2050)>0
and a.AQ2051 is null
group by c.ac2037
update a set 图片库存=图片库存+ai0015 from '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload a join #在途库存 b on a.条形码=b.ac2037
end
'
set @sql4='
---图片库存修改小于0的传0
SELECT a.条形码,a.主商家编码,a.商品id,a.商品数字id,a.商品属性,a.网店产品名称,a.规格,a.是否主产品,a.子产品存在,a.上次更新数量,Convert(INT,CASE
WHEN dbo.fun_defaultv(b.最小下架数量,''[0,]'',0)<floor(dbo.fun_minv(DEFAULT,dbo.fun_defaultv(预上架数,''(0,]'',null),dbo.fun_defaultv(图片库存,''[0,]'',0)* dbo.fun_defaultv(Isnull(b.上架百分比,100),''[0,100]'',100)/100.0))THEN floor(dbo.fun_minv(DEFAULT,dbo.fun_defaultv(预上架数,''(0,]'',null),dbo.fun_defaultv(图片库存,''[0,]'',0)* dbo.fun_defaultv(Isnull(b.上架百分比,100),''[0,100]'',100)/100.0))
ELSE 0
END)图片库存,CASE
WHEN 图片库存>0
AND Isnull(A.最小下架数量,0)<=图片库存 THEN ''可以上架''
ELSE ''下架''
END AS 状态比较,CASE
WHEN 图片库存>0
AND Isnull(A.最小下架数量,0)<=图片库存 THEN ''可以上架''
ELSE ''下架''
END AS 操作类型,CASE
WHEN Isnull(备用4,0)=1 THEN ''1''
ELSE ''0''
END AS 启用上下架,Isnull(A.最小下架数量,0)最小下架数量,100 上架百分比,数量 AS 网店数量,Isnull(b.预上架数,0)预上架数,Isnull(a.图片库存,0)可用图片库存,Isnull(b.上架百分比,100)设置上架百分比,网店产品状态,操作结果,选择,0 AS [check],b.objid oid
,品名,上架日期,下架日期,b.备用1 as 自动上下架状态,''False'' as 是否更新条形码,
a.店铺销售价,a.软件销售价,b.存在状态
INTO #gg
FROM '+@dbname+'.'+@wfpuser+'wfpuser_a0304autoUpload a
JOIN '+@dbname+'.wfpuser_a0305 b
ON a.objid=b.objid
AND(a.图片库存 <>Isnull(b.备用2,0)
OR Isnull(b.备用1,''默认更新'')=''启用更新''
OR(Isnull(A.最小下架数量,0)>图片库存
AND Isnull(上次更新操作,''可以上架'')=''可以上架'')
OR(Isnull(A.最小下架数量,0)<=图片库存
AND Isnull(上次更新操作,''下架'')=''下架''))
WHERE b.店铺类型='''+@shoptype+'''
AND b.店铺='''+@shopid+''' and isnull(b.存在状态,'''')=''''
select 选择,启用上下架 as 是否启用上下架,自动上下架状态,品名,条形码,商品id,商品数字id,商品属性,网店产品名称,主商家编码 as 主商家编号,
规格 as 规格, cast(是否主产品 as bit) 是否主产品,子产品存在,预上架数 as 网店数量,网店产品状态,上次更新数量,CASE
WHEN 图片库存<=0 THEN ''下架''
ELSE ''可以上架''
END 状态比较,
CASE
WHEN 图片库存<=0 THEN ''下架''
ELSE ''可以上架''
END 操作类型,
操作结果,最小下架数量,上架百分比,Convert(INT,图片库存)图片库存,
Convert(INT,图片库存) as 原图片库存,
上架日期,
下架日期,
是否更新条形码,
店铺销售价,
软件销售价,
存在状态
from #gg
'
exec pr_写系统日志 '图片库存计算开始','自动上下架',@shopid,@wfpuser,@dbname
exec pr_更新网店拍下库存 @dbname
exec pr_写系统日志 '图片库存计算结束','自动上下架','ab',@wfpuser,@dbname
EXEC sp_executesql @sqltz
SET @sql3=@sql3+@sql4
EXEC sp_executesql @sql3
print(@sql3+@sql4)
return;
end
GO