Alex Rivera | Logout

What's the difference between TRUNCATE and DELETE in SQL

Asked 2008-09-26T13:53:31.070
405

What's the difference between TRUNCATE and DELETE in SQL?

If your answer is platform specific, please indicate that.

Edit
Report

2 Answers

1

The biggest difference is that truncate is non logged operation while delete is.

Simply it means that in case of a database crash , you cannot recover the data operated upon by truncate but with delete you can.

More details here

answered 2008-09-26T13:56:46.303
0

I'd comment on matthieu's post, but I don't have the rep yet...

In MySQL, the auto increment counter gets reset with truncate, but not with delete.

answered 2008-09-27T01:08:01.867

Your Answer