rss
twitter
  •  

Delete & Truncate are different @ SQL

| Posted in Uncategorized |

0

Delete & Truncate have identical tasks (Delete data from table) but with the following differences: (Note that you may have this question @interview :) :))

  • Truncate:
    • DDL command
    • can’t be rolled back, all of the memory space is released back to the server.
    • much faster
    • don’t check constraints
  • Delete:
    • DML command
    • can rollback
    • slower than Truncate command
    • check constraints, if exists then show errors

Post a comment