存储过程问题
我要同时返回参数和记录和记录集,请问怎么做,我用下面总是做不好
存储过程,自己测试过,存储过程是没有问题的
create procedure mainboard_graphTypeno
@second int output,
@yyear int,
@mmonth int
as
begin
select @second=count(*) from (select *from mainboard where year(fix_date)=@yyear and month(fix_date)=@mmonth) a
inner join (select typename from mainboard where year(fix_date)<=@yyear and month(fix_date)<=@mmonth
group by typename having count(typename)>=2) b on a.typename=b.typename
select typeno,dd=(select count(1) from mainboard where typeno=a.typeno and year(fix_date)=@yyear and month(fix_date)=@mmonth and type='主板') from mainboard a where year(fix_date)=@yyear and month(fix_date)=@mmonth and type='主板' group by typeno
order by dd desc
asp文件
set cmd=server.CreateObject("adodb.command")
cmd.ActiveConnection=conn
cmd.CommandText="dbo.mainboard_graphTypeno"
cmd.CommandType=4
cmd.Prepared=true
cmd.Parameters.Append cmd.CreateParameter("@second",2,3)
cmd.Parameters.append cmd.CreateParameter("@yyear",3,1,4,yyear)
cmd.Parameters.append cmd.CreateParameter("@mmonth",3,1,4,mmonth)
'set rs=server.CreateObject("adodb.recordset")
'rs.Open cmd,,1,1
set rs=cmd.execute
rowcount=cmd.Parameters("@second").value
do while not rs.eof
....
rs.MoveNext
loop