473,779 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3922
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*********@sa n.rr.comwrote in message
news:11******** **************@ m7g2000cwm.goog legroups.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.Fil l 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*********@sa n.rr.comwrote in message
news:11******** **************@ m7g2000cwm.goog legroups.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
7580
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
2118
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 . exec Multiple --manipulate result set A
3
2550
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 on individual product names. I am getting data by calling the same stored procedure multiple times... for the single set of data I use "product like '%'" To get the data for individual products, I am using a cursor to parse
6
26545
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 regards
2
5459
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
5
16560
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 ADO.Net, but it doesn't work. It doesn't even display the result in the query analyzer unless I add SELECT @ReturnFullName Any help? The stored procedure:
1
1212
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 added the parameter, but I cannot get the result by sqldatareader = sqlcommand.executereader. I ensure that there is one row return. Besides, I would like to use the same sqlcommand to run a number of
1
2718
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
3366
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 tool should take as input the names of the 2 SPs, a set of parameter values and invoke them. Internally it should compare the result sets returned and log/ display the difference in result sets if any. We do not want to compare response time,...
0
9632
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10071
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.