Click here to Skip to main content
15,885,862 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi..
Is TRUNCATE table is rolled back?
Posted

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/[^]
 
Share this answer
 
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[^]
 
Share this answer
 
v2
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/[^]
 
Share this answer
 
Comments
thatraja 14-Nov-11 7:28am    
I thought it's impossible one
5!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900