Possible Duplicate:
How to SELECT * INTO [temp table] FROM [stored procedure]
I have a nested stored procedure call
In one of the stored procedures I want to save the result into a table variable likt this :
INSERT INTO @myTable
EXEC sp_myStoredProcedure
however, because the proc. is nested the following error occurs : An INSERT EXEC statement cannot be nested
The procedure must be called from another procedure, changing this is not an option. I wanted to try to use an output parameter but it still has to be set with a Insert into statement.
What are other options to save the data that is retrieved from the call of a Stored Procedure into a variable ?