Click here to Skip to main content
14,329,627 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi..
Is TRUNCATE table is rolled back?
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

You can - if you use it in a Transaction. There is a discussion of it here: http://www.sql-server-performance.com/forum/threads/how-to-rollback-truncate-operation.16968/[^]
   
Comments
thatraja 14-Nov-11 7:28am
   
I thought it's impossible one
5!
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hi,
You cannot roll back a TRUNCATE TABLE statement, nor can you use a FLASHBACK TABLE statement to retrieve the contents of a table that has been truncated.
Truncate Table Discussion[^]
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 3

Here is a discussion about this

If you use TRANSACTIONS in your code, TRUNCATE can be rolled back. If there is no transaction is used and TRUNCATE operation is committed, it can not be retrieved from log file. TRUNCATE is DDL operation and it is not logged in log file.
http://blog.sqlauthority.com/2010/03/04/sql-server-rollback-truncate-command-in-transaction/[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100