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

12 classic String-based Java interview questions with simple explanations and code.

  1️⃣ Check if a String is a Palindrome Problem Given a string, check if it reads the same forward and backward. Example: "madam...

Featured Posts