I'm analyzing some old SQL code in a stored procedure.
Declare @Var1 money,
@Var2 money,
@Var3 money,
etc...
Select @Var1 = OldValue,
@Var2 = @Var1,
etc...
So I'm wondering how these assignments work when they are both in the same select statement. I'm assuming Var2 = OldValue after the select is called, but I want to be sure.
What are the rules surrounding this situation? Are the assignments executed in the order that they are declared? If so, what value would be assigned to Var2 in the following case:
Select @Var2 = @Var1,
@Var1 = OldValue,
Thanks!