Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Loading multiple tables using stored procedure

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

select another table
Question by:BangorCC
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 44

Assisted Solution

Arthur_Wood earned 200 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.

LVL 12

Accepted Solution

dfiala13 earned 400 total points
ID: 10714597

If you use a DataAdapter's Fill method

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

Assisted Solution

dante469 earned 400 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...


select * from Employee
select * from EmployeeDetail


Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

722 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