473,387 Members | 1,318 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,387 software developers and data experts.

T-SQL - How can I name result sets returned by my Stored Procedure??


SQL Server 2005 SP1 Standard & Express
..NET 2.0 and ADO.NET
C#

Hi,

I have a stored procedure that returns results from 3 select
statements. When I "ExecuteDataset" from C# code the returned dataset
has 3 tables named "Table", "Table1", "Table2"...

Quest: Is there any way that I can use a hint on my select statement or
some other T-SQL option to name the 3 result sets to more descriptive
names like "Customer", "Address", "Product"???

Nov 14 '06 #1
2 3899
I think you name the tables FIRST....

then you try to load them ordinally.

As in... if your first resultset in the stored procedure is Customer(s),
then the first table needs to be Customer.

Check LoadDataSet() also.

"Crash" <so*********@san.rr.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
>
SQL Server 2005 SP1 Standard & Express
.NET 2.0 and ADO.NET
C#

Hi,

I have a stored procedure that returns results from 3 select
statements. When I "ExecuteDataset" from C# code the returned dataset
has 3 tables named "Table", "Table1", "Table2"...

Quest: Is there any way that I can use a hint on my select statement or
some other T-SQL option to name the 3 result sets to more descriptive
names like "Customer", "Address", "Product"???

Nov 14 '06 #2
Hi,

The DataAdapter.Fill method assigns those table names to the result sets. All
results sets are assigned in the order of, "Table", "Table1", "Table2", etc.
You need to map them to tables in your DataSet:

"Setting Up DataTable and DataColumn Mappings"
http://msdn.microsoft.com/library/de...mnmappings.asp

If you're not using a Typed DataSet then you can just rename the tables in
code by setting the TableName property of each DataTable.

--
Dave Sexton

"Crash" <so*********@san.rr.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
>
SQL Server 2005 SP1 Standard & Express
.NET 2.0 and ADO.NET
C#

Hi,

I have a stored procedure that returns results from 3 select
statements. When I "ExecuteDataset" from C# code the returned dataset
has 3 tables named "Table", "Table1", "Table2"...

Quest: Is there any way that I can use a hint on my select statement or
some other T-SQL option to name the 3 result sets to more descriptive
names like "Customer", "Address", "Product"???

Nov 14 '06 #3

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

Similar topics

1
by: Chris Asaipillai | last post by:
I have a problem executing the following Stored Procedure from code. The SP Text runs like this: ALTER PROCEDURE prc_InsertContractDirectStatus­_tmp @var_ContractID VARCHAR(50)
0
by: jamiemcc | last post by:
Hi, I would like to have 1 stored procedure call another stored procedure (which contains multiple select statements) and then be able to access the 3 result sets. Example Create Procedure ....
3
by: wxbuff | last post by:
I have a report based on our product names that consists of two parts. Both insert data into a temporary table. 1. A single grouped set of results based on all products 2. Multiple tables based...
6
by: Terentius Neo | last post by:
Is it possible to combine (in DB2 UDB 8.1) a stored procedure and a select statement? I mean something like this: Select c.number, call procedure( c.number ) as list from table c With best...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
5
by: Wael | last post by:
Hi, I have the following stored procedure that does some processing and puts the result in a temporary table. I tried several things that procedure to display output that I can access with...
1
by: Cylix | last post by:
I am going to use ADO.NET to call a sqlserver stored procedure with 1 parameter The stored procedured will return a record set with one row data. I have already get connection to the server and...
1
by: jason | last post by:
I've got this really simple table with two fields book: name varchar(50) phone varchar(50) and simple stored procedure jcp1: ALTER procedure "jcp1" @name varchar(50) AS
2
by: Yash | last post by:
Hi, We are in the process of tuning the performance of our stored procs in SQL 2000 and are looking for a tool that would help us in comparing the result sets of an old SP and a modified SP. The...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.