I have a stored procedure that queries some results. I have another stored procedure that needs to return the results of the first stored procedure and the results of a query to a table. Currently, the body of this stored procedure looks something like this:
EXEC myFirstStoredProc @param1
SELECT * FROM MyTable
When I execute mySecondStoredProc, the results of MyTable appear. However, the results of the EXEC statement do not appear. How do I get the results of the nested sproc call to appear?
Thank you!
Assuming this is SQL Server what you’ve described should work.
Here’s a sample that you can use to see it in action