We have seen lot of difference between temporary variable and temporary table. Here is a nice difference in Transaction perspective.
Temporary table is transaction dependent and it abides to the database transaction whereas temporary variable is not transaction bound.
table #temp (id int, val varchar(100))
into #temp values (1,'Venkat')
select * from #temp
We are not getting any records indicating the temporary table will bound to the transaction strategies.
@tempval table(id int, val varchar(100))
into @tempval values (1,'Venkat')
select * from @tempval
Even we have provided rollback transaction. Records are available in the table variable.