How would I grab values from a SP that returns a table?CREATE PROCEDURE sp_test@param intASSELECT 1 as param1,1 as param2 ,1 as param3UNIONSELECT 1 as param1,1 as param2 ,1 as param3GO
In another SP, i want to set the values likedeclare @1 int, @2 int, @3 intselect @1 = SUM(a.param1), @2 = SUM(a.param2), @3 = SUM(a.param3) FROMsp_test @param = 10 aprint @1print @2print @3
But this does not work, anyway to grab the fields of my SP as if it was a table alias and pass in a parameters into the SP in a select statement at the same time?