Friday, 22 April 2016

Drop table vs. Truncate table vs. Delete all records


Drop
(Table structure  + Data are deleted)
Invalidates the dependent objects
Drops the indexes
DROP TABLE employee

Truncate
(Data alone deleted)
Performs an automatic commit
Faster than delete
TRUNCATE TABLE employee

Delete
(Data alone deleted)
Doesn’t perform automatic commit
DELETE FROM employee

No comments:

Post a Comment

Note: only a member of this blog may post a comment.