If they have the same set of column names you could do a union of the
results creating a single recordset adding your own custom column to
identify which set of results you are looking at:
SELECT f_name, l_name, 'contact' as myGrouping
FROM contacts
UNION
SELECT f_name, l_name, 'clients' as myGrouping
FROM clients
etc...

But the bigger question is - why is your stored proc returning an
unknown number of recordsets?  This type of question usually can be
answered by revisiting the stored proc to get it to generate a single
recordset in the first place.  If it just gets too complex a different
answer would be to put the results into a temp table and return that
recordset:

SELECT f_name, l_name, 'contact' as myGrouping
INTO #myTempTable
FROM contacts

INSERT INTO #myTempTable
SELECT f_name, l_name, 'clients' as myGrouping
FROM clients

HTH,
Adam Howitt

On Apr 4, 2005 10:06 AM, Johnny Le <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there a way to find out how many recordsets return by a stored procedure?  
> Or is there a way to merge all the recordsets in a stored procedure so that 
> it would only return 1 recordset?
> 
> I have a stored procedure that would return an unknown number of recordsets 
> depending on how many records we have in the database, but each recordset 
> will have the same number of columns and column names.  I need to know the 
> number of recorsets it will return so I can do a loop for the cfprocresult.
> 
> Johnny
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201358
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to