On the MSDN site, I came across this statement:
It doesn't give any context or reason for this. Does anyone know why that's the recommended syntax? It just seems a little clumsier to write:For assigning variables, we recommend that you use SET @local_variable instead of SELECT @local_variable.
... rather than:Code:Set @variable = (SELECT Value FROM Table)
Any opinions gratefully received...Code:Select @variable = Value FROM Table




Reply With Quote