Hi,
While running this set of statements,
declare @Amount as int
set @Amount = 1000
print @Amount
begin tran
set @Amount = @Amount + 1000
print @Amount
begin tran
set @Amount = @Amount + 1000
print @Amount
commit tran
set @Amount = @Amount + 1000
rollback tran
print @Amount
I thought that last statement will rollback the the data and set amount variable to "3000". But its printing "4000"... Will rollback transaction not work for variables?