请教用ASP向存储过程传递参数(表名)为什么出错?请大家帮忙解决!谢谢!代码如下:
在ASP中执行
SqlStr="exec stat_msgdb_step1 "&tablename&","&startday&","&endday&","&"1"
set rs = cnn.Execute(SqlStr)
报错
存储过程:
CREATE PROCEDURE stat_msgdb_step1
(@tablename char,@startday int,@endday int,@feeflag int)
AS
declare @sqlstr char(500)
if @feeflag=1
begin
select serviceid,count(*) as counts,count(distinct srctermid) as hushu
from @tablename where convert(int,feecode)<>0 and srctermid not in (select mobile from usercode) and
convert(int,substring(createtime,1,8))>=@startday, 1) and convert(int,substring(createtime,1,8))<=@endday, 1) and
convert(int,feetype)<>3 group by serviceid order by serviceid
end
if @feeflag=0
……
……