05 September 2009 10:42 tonyrogerson

TRUNCATE TABLE transactional?

create table blah ( 
    acol int ) 

insert blah ( acol ) values( 1 )
insert blah ( acol ) values( 1 )
insert blah ( acol ) values( 1 )
insert blah ( acol ) values( 1 )

begin tran

truncate table blah

select COUNT(*) from blah

rollback

select COUNT(*) from blah

drop table blah

So, yes - it is subject to the transaction; also - it is a logged operation, its just that the individual rows are not logged "individually" like they would if you used DELETE.

 

Filed under: ,

Comments

No Comments