Declare an output cursor variable for internal sp:
@c CURSOR VARYING OUTPUT
Then declare cursor c to select which you want to return. Then open the cursor. Then set the link:
DECLARE c CURSOR LOCAL FAST_FORWARD READ_ONLY FOR SELECT ... OPEN c SET @c = c
DO NOT close or redistribute.
Now call the inner sp from the outer, specifying the cursor parameter, for example:
exec sp_abc a,b,c,, @cOUT OUTPUT
After doing the inner sp, your @cOUT ready to be retrieved. Loop and then close and release.
Stefanos Zilellis May 19 '17 at 12:31 2017-05-19 12:31
source share