1

How can I achieve something like this :

SELECT * DISTINCT FROM (execute dbo.MyStoredProcedure(@ID1,@ID2)) 

suppose that's inside another stored procedure.

How can I call a stored procedure from another stored procedure and get the result as a table (my select is intended for that)

1

2 Answers 2

2

Try

DECLARE @TableTemp TABLE (--declare parameters, ouput from SP) INSERT INTO @TableTemp EXEC dbo.MyStoredProcedure @ID1,@ID2 SELECT * FROM @TableTemp 
Sign up to request clarification or add additional context in comments.

Comments

1

You can do something like this.

INSERT INTO #temp EXEC MyStoredProcedure(@ID1,@ID2) SELECT * FROM #temp 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.