Check our online training feedbacks Here

27 February 2011

Truncate Within A Transaction

In the previous post, we have seen, what is the difference between in “Truncate vs. Delete”?

Actually if we use truncate then we can’t rollback the data, but the question is … What will happen if we use truncate within a transaction, Whether we can rollback or not?.

The following example reveals the answer for our question.

I created a table and inserted a rows, as shown below

Then I executed the below Query:

It Returns:

Conclusion:
Truncated Data can be roll backed if it is executed within a transaction

No comments :

Post a Comment

Your comments, Feedbacks and Suggestions are very much valuable to me :)