Why I'm not able to roll back the truncate statement via rollback statment????
I guess we can't roll back truncate statement same as drop
one more thing You guys forgot to use truncate statement and didn't even shows up truncate command to be executed
"TRUNCATE TABLE table_name"
2 answers ( 0 marked as helpful)
Hello Mayank,
As per the MySQL documentation, TRUNCATE works by DROPping the table and re-creating it as blank, which is apparently faster than deleting rows one by one. Then, it causes an implicit commit, thus it cannot rolled back.
Best,
Carl
Hi Mayank and Carl!
Thanks for reaching out.
@: Carl
Thanks for sharing this piece of information with the Community!
@: Mayank
Carl said it all. TRUNCATE
works by droping the table and re-creating it as blank and cannot be rolled back.
Hope this helps.
Best,
Tsvetelin