Skip to main content

Difference between DELETE and TRUNCATE

This is the common interview question for every SQL Developer and DBA position.
DELETETRUNCATE
DML (Data Manipulation Language) Command.DDL (Data Definition Language) Command.
It can be rollback.It can't be rollback.
Using DELETE we can remove some or all records from the table. We can use WHERE clause with it.Using TRUNCATE we can remove all records from the table at once. We can't use WHERE clause with it.
DELETE command is slow in performance.TRUNCATE command is super faster in performance.
All deleted Triggers fire on DELETE command.No Trigger can be fired on TRUNCATE command.
DELETE can't reset high water mark.TRUNCATE can reset high water mark.
DELETE can't release the space from the table.TRUNCATE can release the space from the table.

Comments

Popular posts from this blog

Photo : Savitri during her last days

Even after 4 decades of her death, people are very much interested to watched her (Savitri) biopic. Mahanati turned to be stupendous success. On eve of remembering Savitri, here we posted Savitri photo. The photo seems her last days. The man stand behind Savitri is Gemini Ganeshan who married Savitri. It seems that she suffered bad days during her last days.

Police Attacked Asaduddin Owaisi - Rarest Photo

Girl signed on 100/- Stamp Paper for getting 5K!

YSRCP Govt gave notification for more than 2.6 lakh jobs for Village Volunteers and was selected through interview process. All unemployed youth from SSC to Graduate were applied for the posts.