存储过程里有若干个selec和返回参数:
@z_count int output,
@z_sum int output
AS
BEGIN
select @z_count=Count(*) from news_tab
select @z_sum=sum(click) from news_Tab
select classFir,count(*) from news_tab group by classFir
END
这样多样式的结果集前台怎么处理阿???
...全文
382919打赏收藏
使用SQL存储过程返回多结果集怎么处理
存储过程里有若干个selec和返回参数: @z_count int output, @z_sum int output AS BEGIN select @z_count=Count(*) from news_tab select @z_sum=sum(click) from news_Tab select classFir,count(*) from news_tab group by classFir END 这样多样式的结果集前台怎么处理阿???
store procedure:
_________________________________________________
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[outputParms]
(
@count int output,
@sum int output
)
AS
BEGIN
declare @t table(id int identity(1,1), value int)
insert into @t
select 10 union all
select 20 union all
select 30
select @count = count(1), @sum = sum(value) from @t
@z_count int output,
@z_sum int output
AS
BEGIN
set @z_count=Count(*) from news_tab
set @z_sum=sum(click) from news_Tab
select classFir,count(*) from news_tab group by classFir
END