Comparison of SQL Delete, Truncate and Drop


Delete

  1. It is a DML statement
  2. Rollback is possible after execution
  3. Triggers can fire out
  4. Where clause can use for condition
  5. Table structure will exists

Truncate

  1. It is a DDL statement
  2. Rollback not possible
  3. Trigger fire out not possible
  4. Cant apply where clause
  5. It is very fast compare to delete
  6. Table structure will exists

Drop

  1. Table structure will not exists 
  2. Roll back not possible

No comments:

Post a Comment

Model Context Protocol (MCP) — Complete Guide for Backend Engineers

  Model Context Protocol (MCP) — Complete Guide for Backend Engineers Build Tools, Resources, and AI-Driven Services Using LangChain Moder...

Featured Posts