> <cfstoredproc procedure="procedure_name" datasource="#maindsn#">
> <cfprocresult name="result1">
> <cfprocresult name="result2">
> </cfstoredproc>

The only difference is you need to add the RESULTSET attribute, like this...
<cfprocresult name="result1" resultset="1">
<cfprocresult name="result2" resultset="2">

The RESULTSET attribute is what determines where the results go.  They
simply go in order
of where they are placed in your stored procedure, so if you have

Select * from people

Select * from animals

The results from the people table would be in result1, and the results from
the animal table would
be in result2.

Pretty slick, eh?

JS

----- Original Message -----
From: "Mark Stewart" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, October 04, 2001 8:17 AM
Subject: Stored Procedure Question


> All,
>
> I've been using stored procedures for a while now but I've never really
> needed to create one that returned multiple result sets. My question is,
> how do you do that? Would someone be kind enough to show me a little
> pseudo code or a snippet of code on how to accomplish this?
>
> I assume in cf, I would build my cfstoredproc like this:
>
> <cfstoredproc procedure="procedure_name" datasource="#maindsn#">
> <cfprocresult name="result1">
> <cfprocresult name="result2">
> </cfstoredproc>
>
> But I draw a blank when it comes to building the stored proc in SQL
> Server where it would return multiple results. I assume the following:
>
> create procedure [procedure] as
>
> select ... from ... where...
>
> select ... from... where...
>
> How do I specify what query goes with what result?
>
> Thanks for your help!
>
> Mark
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to