Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Rollback TRUNCATE TABLE?...

Author  Topic 

Dennis
Starting Member

11 Posts

Posted - 2007-03-13 : 05:03:23
Hi again,
I've heard and read that it's not possible to roll back a "TRUNCATE TABLE" statement, but I obviously can.

BEGIN TRAN
truncate table mytable
rollback tran

--> data is back in the table.
I'm I misunderstanding something when people say you can't rollback a truncate statement? Thanks!

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2007-03-13 : 06:09:15
obviously it can be. then wats the prob?

Mahesh
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-03-13 : 06:31:53
The TRUNCATE TABLE statement used not to be logged - SQL Server version 7, or maybe 6.5 - but no problem with newer versions.

Kristen
Go to Top of Page

Dennis
Starting Member

11 Posts

Posted - 2007-03-13 : 07:02:58
The problem was that the documentation and posts I've read on other forums was not what I was seeing in my own experiments. But apparently it's "fixed" in later versions.
thanks
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-03-13 : 07:04:28
see point 2 on this..

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80349
Go to Top of Page
   

- Advertisement -