Solved

Loading multiple tables using stored procedure

Posted on 2004-03-30
3
457 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now