Solved

Loading multiple tables using stored procedure

Posted on 2004-03-30
3
459 Views
Last Modified: 2012-06-21
is it possible to write a stored procedure that when run in vb.net that it would fill multiple tables in the dataset?
maybe something like
select one table
.
.
.
go

select another table
.
.
.
go
0
Comment
Question by:BangorCC
3 Comments
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 50 total points
ID: 10714576
yes.  For instance, if you use a DataReader, you can then issue a NextResult method, to move to the second set of records.

AW
0
 
LVL 12

Accepted Solution

by:
dfiala13 earned 100 total points
ID: 10714597
Yes.

If you use a DataAdapter's Fill method

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassfilltopic.asp

It will automatically populate the dataset with all the returned tables defined by the multiple select statements.
0
 
LVL 7

Assisted Solution

by:dante469
dante469 earned 100 total points
ID: 10716733
Depending on the version of SQL you may not be able to put GO in your stored proc....  You do not need GO between each select :)...

The following stored proc will return multiple tables that are easily accessible from the DataAdapters.fill method...

CREATE PROCEDURE DBO.sp_EmployeeDump  AS

select * from Employee
select * from EmployeeDetail

GO
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question