-
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks