Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments:
SET @proc = 'sp_madeupname' SET @magic_number = 42 SET @tomorrows_date = DATEADD(dd, 1, GETDATE()) ...
Clearly doing all of the above as one SELECT would be faster:
SELECT @proc = 'sp_madeupname' ,@magic_number = 42 ,@tomorrows_date = DATEADD(dd, 1, GETDATE()) ...
But how much faster? Say if this stored procedure was executed as part of a loop, several thousand times, is it going to make any significant difference to the performance?
In this case, SELECT wins, performance-wise, when performing multiple assignments.
Here is some more information about it:
SELECT vs. SET: Optimizing Loops