473,569 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mutiple Table from Stored procedure

4 New Member
Hi
I am using windows applicaiton(.ne t) as front end,
and I want to get mutiple tables in Dataset by executing a single stored procedure i.e.
SP would return mutiple tables (record sets) with the user specified name.
can anybody guide me no this?

thanks.
Jan 28 '09 #1
6 2161
ck9663
2,878 Recognized Expert Specialist
If you are talking about linking multiple tables, you have to find a key that can be use to link those tables and use a JOIN to link them all together.

If you're talking about concatenating those tables, then you just have to match which columns goes to which columns and use UNION ALL.

Happy coding!

-- CK
Jan 28 '09 #2
dewraj
4 New Member
thanks ck9663,

Please have look,

create proc mutiDataSet
As
Begin
select * from temp1
select * from temp2
End

I need to create one procedure in above way but when it execute it returns mutiple record set to front end application e.g. .net dataset
those tables can be accessed in following way.
ds.table[0].
ds.table[1].
but inspite of putting 0,1.... I want get some table name form SP
somthing like -
create proc mutiDataSet
As
Begin
(select * from temp1) as EmpData
(select * from temp2) as DeptData
End
so that I can access in below way
ds.table[EmpData].
ds.table[DeptData].

how it can be possible?
Jan 28 '09 #3
ck9663
2,878 Recognized Expert Specialist
This would depend on your front-end apps. Try posting this question in the .Net forum for the basics (ie, how to connect to sql server, how to read recordsets, etc). Then we can discuss the T-SQL that will process your data.

Good luck!

-- CK
Jan 28 '09 #4
dewraj
4 New Member
ok,thanks,I will do.

however is it possible to name mutiple record set in store procedure ?

something like -

create proc mutiDataSet
As
Begin
(select * from temp1) as EmpData
(select * from temp2) as DeptData
End

thanks
Jan 28 '09 #5
ck9663
2,878 Recognized Expert Specialist
No.

Either you create a separate recordset for each table. Or you can use UNION ALL and add a field that can help you identify which table the row came from.

-- CK
Jan 28 '09 #6
dewraj
4 New Member
Thanks ck9663 ,

I check with microsoft as well they says-

"In sort, there's no way to actually "name" your result sets. You're stuck using the 0-based result set ordinal in your client code.
Sorry!
Aaron Alton | [COLOR=#0072bc]thehobt.blogspo t.com[/COLOR]"
Jan 29 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4953
by: Robin Tucker | last post by:
Hi, I'm trying to determine with my program whether or not a given database supports a given feature set. To do this I'm querying for certain stored procedures in the sysobjects table and if they are present, making the assumption the database will support the given feature. The problem is I can't find a certain stored procedure in the...
10
5594
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I create a single View and specify also in this View the WHERE clause that is common in these stored procedures, I will have the new stored procecures...
7
7949
by: Mike Hubbard | last post by:
I have read many many messages about temporary tables and stored procedures. Still, I am struggling with a simple concept. I have a java program which creates a temporary table. I now want to access (read) this table in a stored procedure (written in SQL). This stored procedure is called from the same java program. My question is - how...
1
3687
by: Lauren Quantrell | last post by:
I have read the newsgroups and see this is a common issue but I saw no resolution for it: I have an Access2K frotn end and SQL Server 2K backend. In access, I create a temp table using code in a module: strSQL = "CREATE TABLE #tempTableName ("TempID int NOT NULL IDENTITIY (1,1) PRIMARY KEY, Field1 int...) CurrentProject.Connection.Execute...
1
1758
by: BigD | last post by:
This all centers around an Access Data Project I have a stored procedure that aggregates events stored in a table based on intervals I specify. I have a form that supplies parameters for the stored procedure. My procedure creates a temp table to populate with the results. The problem I have is that I cannot create a form or report that uses...
6
9888
by: Peter Neumaier | last post by:
Hi, I am trying to select some data through a stored procedure and would like to store the result in a local access table. Is that possible? Can somebody provide an example? Thanks&regards! Peter
1
3333
by: jobs | last post by:
I have a growning list of stored procedures that accept a single string as a parameter. The list and parameters are maintained in a table with two columns. Some of the Stored procedures take hours to complete. procedures and the page come right back and recording infomation about the stored procedure (like a job number) that can later...
13
5212
nabh4u
by: nabh4u | last post by:
hi, I am trying to insert multiple rows in a table using PL/SQL. I have two procedures and two tables. the first procedure gets the data from the source table, manipulates it and then sends the data to the second procedure which inserts the data into the target table. The way i do it, it inserts only one row into the target table. I am not able...
2
4072
by: acw | last post by:
On a SQL Server 2000 db I would like to setup a stored procedure that accesses couple tables and runs the extended stored procedure xp..cmdshell. The goal is to grant users with limited privileges the right to run the stored procedure but not the rights to directly access either the referenced tables or the extended stored procedure. TIA!
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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...
0
5223
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...
0
3657
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...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
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
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.