Create a single rowset out of returned multiple rowsets


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Create a single rowset out of returned multiple rowsets

  1. #1
    Gthompson Guest

    Create a single rowset out of returned multiple rowsets


    Is it possible to create one rowset with the returned rowsets of 2 different
    sprocs?

    Example:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Create proc sp1
    @ID1 int
    as
    Select fname, lname From Customer where ID = @ID1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Create proc sp2
    @ID2 int
    as
    Select item from Product where ID=@ID2

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Create proc sp3
    @ID1 int,
    @ID2 int
    as
    //Here is where I want create one rowset out of 2 different sproc by executing
    them.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  2. #2
    Michael Levy Guest

    Re: Create a single rowset out of returned multiple rowsets

    It can be done. You could use the INSERT EXECUTE statement to load the
    results of both stored procedures into the same temp. table and SELECT from
    the temp table to get the single result set. Remember the results from the
    two stored procedure will have to have the same number of columns and
    consist of compatible data types.

    -Mike
    --
    Michael Levy MCSD, MCDBA, MCT
    Consultant
    GA Sullivan
    michaell@gasullivan.com




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center