Hi @Siver
You need another parameter to receive the output value in the Execute clause.
Try this:
EXEC SP_TestOutput @GroupNum=1001 , @max_value=@max_value_final OUTPUT
Select ID
From mytable Where Col2 = @max_value_final
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.