roccorocks
Programmer
How do I retrieve information from a stored procedure with multiple queries? My stored procedure looks something like this below:
CREATE PROCEDURE spCount1
@dateIn smalldatetime,
@listN int
as
select class, count(class) as count1
from accountinfo
where (listnum = @listn) and (lastin = @datein) and curbalance <=250
group by class
select class, count(class) as count2
from accountinfo
where (listnum = @listn) and (lastin = @datein) and curbalance >250
group by class
go
I am passing 2 values and want to return both count1 and count2. Currently only the last query performed is accessible (the data).
In the query analyzer the information is displayed in multiple grids. I have gone through some of my SP books and have not found any information on this (do I need to set up cursors? If so, how?)
thanks,
Rocco
CREATE PROCEDURE spCount1
@dateIn smalldatetime,
@listN int
as
select class, count(class) as count1
from accountinfo
where (listnum = @listn) and (lastin = @datein) and curbalance <=250
group by class
select class, count(class) as count2
from accountinfo
where (listnum = @listn) and (lastin = @datein) and curbalance >250
group by class
go
I am passing 2 values and want to return both count1 and count2. Currently only the last query performed is accessible (the data).
In the query analyzer the information is displayed in multiple grids. I have gone through some of my SP books and have not found any information on this (do I need to set up cursors? If so, how?)
thanks,
Rocco