I have a stored procedure that must return the result of execution of a single query, but I have to call another procedure multiple times during execution of my procedure.
The problem is the result of the second procedure is being returned in addition to mine.
Here is my proc:
WHILE (@@sqlstatus = 0)
exec ANOTHER_PROC 'param', @result output
UPDATE #TMP SET param = @result WHERE CD = @cd
FETCH data_cursor INTO @cd
DEALLOCATE CURSOR data_cursor
SELECT * FROM #TMP
Here is the called proc:
CREATE PROCEDURE ANOTHER_PROC (@param char(5), @result Numeric(5,2) = 0 output) As
Select @PcILM = cilm.PcILM
From VW cilm,
Select PcILM = @PcILM
Do you know how to get only the @result value without getting the result of the last SELECT?