---
title: "What is the difference between DELETE and TRUNCATE commands?"  
description: "What is the difference between DELETE and TRUNCATE commands?"  
author: "Rahul Roi"  
published: 2019-05-06  
updated: 2020-09-16  
canonical: https://www.mindstick.com/interview/23508/what-is-the-difference-between-delete-and-truncate-commands  
category: "database"  
tags: ["database", "sql server"]  
reading_time: 2 minutes  

---

# What is the difference between DELETE and TRUNCATE commands?

Mostly **DELETE command** is used to remove rows from the table, and WHERE clause can be used for conditional set of parameters. Here Commit and Rollback operation can be performed or used after delete statement.

Into the **TRUNCATE** **command** removes all rows from table. And the Truncate operation cannot be rolled back. In other word, Commit and Rollback operation can't be performed in TRUNCATE operation.

| **Delete command** is used to delete a row in a table. | **Truncate** is used to delete all the rows from a table. |
| --- | --- |
| You can rollback data after using delete statement. | You cannot rollback data. |
| It is a DML command. | It is a DDL command. |
| It is slower than truncate statement. | It is faster. |

## Answers

### Answer by Rahul Roi

Mostly **DELETE command** is used to remove rows from the table, and WHERE clause can be used for conditional set of parameters. Here Commit and Rollback operation can be performed or used after delete statement.

Into the **TRUNCATE** **command** removes all rows from table. And the Truncate operation cannot be rolled back. In other word, Commit and Rollback operation can't be performed in TRUNCATE operation.

| **Delete command** is used to delete a row in a table. | **Truncate** is used to delete all the rows from a table. |
| --- | --- |
| You can rollback data after using delete statement. | You cannot rollback data. |
| It is a DML command. | It is a DDL command. |
| It is slower than truncate statement. | It is faster. |


---

Original Source: https://www.mindstick.com/interview/23508/what-is-the-difference-between-delete-and-truncate-commands

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
