473,395 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Multiple Recordsets from 1 Stored Procedure

Hi there,
I have a Stored Procedure in SQL 2000 that takes 10 input paremeters,
and outputs 11 recordsets, not rows, but 11 different SELECT statements.

The purpose of this is to for a menu system in a store. If all the
inputs are NULL, then just the top level categories are output in the
first recordset. The ID of each category will then be passed back into
the stored procedure where it then filters the second recordset to
create the second level of categorisation.

Can ASP Classic with VBScript pull multiple recordsets from a stored
procedure? Can anyone point me to some online resources?

Cheers,

Steve
Jun 27 '08 #1
3 9994
"Dooza" <st*****@SPAM.dooza.tvwrote in message
news:OH**************@TK2MSFTNGP05.phx.gbl...
Hi there,
I have a Stored Procedure in SQL 2000 that takes 10 input paremeters,
and outputs 11 recordsets, not rows, but 11 different SELECT statements.

The purpose of this is to for a menu system in a store. If all the
inputs are NULL, then just the top level categories are output in the
first recordset. The ID of each category will then be passed back into
the stored procedure where it then filters the second recordset to
create the second level of categorisation.

Can ASP Classic with VBScript pull multiple recordsets from a stored
procedure? Can anyone point me to some online resources?
The standard ADODB Recordset object will expose the first result set
returned.

When you have consumed that set use the method .NextRecordset() on the
recordset object. It will now exposed the second result set. Continue
doing that until all result sets are used.

See:-

http://www.4guysfromrolla.com/webtech/083101-1.shtml
--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #2
Anthony Jones wrote:
"Dooza" <st*****@SPAM.dooza.tvwrote in message
news:OH**************@TK2MSFTNGP05.phx.gbl...
>Hi there,
I have a Stored Procedure in SQL 2000 that takes 10 input paremeters,
and outputs 11 recordsets, not rows, but 11 different SELECT statements.

The purpose of this is to for a menu system in a store. If all the
inputs are NULL, then just the top level categories are output in the
first recordset. The ID of each category will then be passed back into
the stored procedure where it then filters the second recordset to
create the second level of categorisation.

Can ASP Classic with VBScript pull multiple recordsets from a stored
procedure? Can anyone point me to some online resources?

The standard ADODB Recordset object will expose the first result set
returned.

When you have consumed that set use the method .NextRecordset() on the
recordset object. It will now exposed the second result set. Continue
doing that until all result sets are used.

See:-

http://www.4guysfromrolla.com/webtech/083101-1.shtml
Hi Anthony, thank you, that should do the job perfectly!

Steve
Jun 27 '08 #3
Anthony Jones wrote:
"Dooza" <st*****@SPAM.dooza.tvwrote in message
news:OH**************@TK2MSFTNGP05.phx.gbl...
>Hi there,
I have a Stored Procedure in SQL 2000 that takes 10 input paremeters,
and outputs 11 recordsets, not rows, but 11 different SELECT statements.

The purpose of this is to for a menu system in a store. If all the
inputs are NULL, then just the top level categories are output in the
first recordset. The ID of each category will then be passed back into
the stored procedure where it then filters the second recordset to
create the second level of categorisation.

Can ASP Classic with VBScript pull multiple recordsets from a stored
procedure? Can anyone point me to some online resources?

The standard ADODB Recordset object will expose the first result set
returned.

When you have consumed that set use the method .NextRecordset() on the
recordset object. It will now exposed the second result set. Continue
doing that until all result sets are used.

See:-

http://www.4guysfromrolla.com/webtech/083101-1.shtml
Have to say this is a brilliant way to work with stored procedures, I
wish I knew about it sooner!

Steve
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dr. Killer D. Goat The Man Eater | last post by:
I have a stored procedure that returns multiple select statements. eg. select one from table_One Select two from table_two
7
by: (Pete Cresswell) | last post by:
I posted this in the MS Access group, but no luck. ------------------------------------------ I've got another stored procedure in the same app that returns multiple recordsets and the code works....
1
by: Cliff | last post by:
here's my code: my $sth = $dbhSQL->prepare('{call proc(?,?,?)}'); $sth->bind_param(1,"asd"); $sth->bind_param(2,"klm"); $sth->bind_param_inout(3,\$no_go, 1000); $sth->execute; print "no go =...
2
by: Keith Chadwick | last post by:
I prefer to use stored procedures over having sql statements sitting in my ..NET code. My problem is I can not figure out how get .NET to understand there are multiple recordsets coming back. ...
12
by: Scott | last post by:
Front-end Access 2000 I have a stored procedure that has 2 parameters BusinessUnitID and Year. It returns multiple record sets (5 to be exact). I thought I could use a Pass through query but...
1
by: Lyle Fairfield | last post by:
MS-SQL 2000, Access 2003, ADO 2.8 Please, consider the SQL string in the following code: Dim r As ADODB.Recordset Dim r2 As ADODB.Recordset Set r = CurrentProject.Connection.Execute( _ "SET...
16
by: Randy Harris | last post by:
I was inspired by the recent discussion of returning multiple recordsets to ADO from a stored procedure. (Amazed is probably more accurate). I asked about how to accomplish same with Oracle and...
1
by: stjulian | last post by:
I have a stored procedure which returns 2 tables and 1 output value. I want the first table to be assigned to rs1 and the second to rs2. However when I run this, I get the following error as I...
4
by: =?Utf-8?B?TWFkaXNvbg==?= | last post by:
Hi all, Could I use the sqldatasource with stored-procedure to return multiple recordset? I did not want to have any sqldatasourec in the one page just to return the record back to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.