Hello!
My textbook says there are two ways to assign a value to a variable: the SET and the SELECT:
Nevertheless I see the following example (on this page) that illustrates the third way (EXEC @var...) :
DECLARE @return_status INT;
EXEC @return_status = checkstate '2';
SELECT 'Return Status' = @return_status;
GO
Could you imagine any reason why that type of assigning a value to a variable was not mentioned in a book (something like ~that's not the ordinary way to do it, it can only be used for assigning the values from the RETURN and etc...)?
Thank you in advance,
Michael