Experts,I have a sime queries as follows. I update a temp table using SQL Server UPDATE statement. What I do not understand is the order of table column and a variable in the SET clause causes one update query works but the other does not.Any explanation would be greatly appreciated.create table #t (ID int identity(1,1), amount money, accumulativeAmount money default(0))create clustered index IX_t on #t(ID)declare @accumulativeAmount moneyinsert #t(amount)values(10)insert #t(amount)values(20)insert #t(amount)values(30)insert #t(amount)values(40)insert #t(amount)values(50)--select @accumulativeAmount= 0.00-- problem version update tset accumulativeAmount = @accumulativeAmount = amount + @accumulativeAmountfrom #t t-- working versionupdate tset @accumulativeAmount = accumulativeAmount = amount + @accumulativeAmountfrom #t t-- checkselect * from #t-- dropdrop table #t