What is the difference between TRUNCATE and DELETE when removing all rows from a table?

SQL Data Analyst Hard

SQL Data Analyst — Hard

What is the difference between TRUNCATE and DELETE when removing all rows from a table?

Key points

  • TRUNCATE is DDL, DELETE is DML
  • TRUNCATE resets identity columns
  • DELETE is fully transactional
  • TRUNCATE cannot be rolled back in most databases

Ready to go further?

Related questions