0

I have a stored procedure with input parameters which returns two result sets.

Out of the two result sets, I have to fetch the second one through the query. Could you please help with this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    AFAIK that's impossible to do with pure t-SQL. I remember looking for a solution for this a few years back and came up with nothing. – Zohar Peled Oct 21 '18 at 04:22
  • 1
    Possible duplicate of [Access to Result sets from within Stored procedures Transact-SQL SQL Server](https://stackoverflow.com/questions/58940/access-to-result-sets-from-within-stored-procedures-transact-sql-sql-server) You will see in the accepted answer it's impossible in pure t-sql, but in the second answer you will see it can easily be done using an sql-clr function. – Zohar Peled Oct 21 '18 at 07:15

0 Answers0