Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Multiple named results sets from stored procedure??

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-11-18 : 08:27:56
mike writes "First, let me explain what i am trying to do.

I am building an asp.net/SqlServer2000 application for a and will be using stored procedures for all data access and will be using the Microsoft Data Access Application Block to get at those stored procedures from C#. Performance is not a big deal either, since it's a pretty small app.

Anyway, I would like to write a single stored procedure that returns multiple result sets like

select col1, col1 from Model where modelID=1
select col1, col2 from ModelSports where modelID=1

to get all information on a model at once. Using the MDAAB executeDataSet method, it works great. But the tables come back in the dataset named "Table" and "Table1". Right now, i just rename the tables in the dataset once i get the dataset back in C# code. I would like to modify the MDAAB to accomidate this.

My Main question is:
1. Is there a way to assign/return a name for a result set using t-SQL?

And just in general:
2. Is this a bad practice, returning multiple result sets with t-sql?


Thanks! Mike"
   

- Advertisement -