If you need other indexes in the table, different from those that can be created in the temp table variable, or for large data sets (which are hardly stored in available memory), when the width of the table (the number of bytes per row) exceeds a certain threshold (this due to the fact that the number or rows of data on the input / output page are reduced, and productivity is reduced ... or if the changes you plan to make in the data set should be part of a transaction with several operations that can be rolled back (from changes in table variables are not written to the transaction log, changes in temp tables ...)
this code demonstrates that table variables are not stored in the transaction log:
create table
declare @T table (s varchar(128))
insert into
insert into @T select 'old value @'
begin transaction
update
update @T set s='new value @'
rollback transaction
select * from
select * from @T
source
share