Advertisement

10.13.2008 at 08:41AM PDT, ID: 23809808 | Points: 400
[x]
Attachment Details

Unioning Stored Procedure Datasets

Asked by DBag1 in MS SQL Server, SQL Server 2005

Tags: , ,

I have a stored procedure that calls another stored procedure 3 times.  Each time is with a different parameter value.  This produces 3 separate datasets that are returned form the shell procedure.  How can I union these into 1?

Basically what I have now just looks like

EXEC sp @test = x
EXEC sp @test = y
EXEC sp @test = z

I've tried inserting into a temp table and then selecting form that but I get an error that says "An INSERT EXEC statement cannot be nested."

Start Free Trial
[+][-]10.13.2008 at 09:13AM PDT, ID: 22703637

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 11:29AM PDT, ID: 22704911

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 12:40PM PDT, ID: 22705635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628