0 votes
in Sql by
What is the difference between DELETE and TRUNCATE statements?

2 Answers

0 votes
by
The TRUNCATE command is used to delete all the rows from the table and free the space containing the table.

The DELETE command deletes only the rows from the table based on the condition given in the where clause or deletes all the rows from the table if no condition is specified. But it does not free the space containing the table.
0 votes
by
The main difference between them is that the delete statement deletes data without resetting a table's identity, whereas the truncate command resets a particular table's identity.

Related questions

+1 vote
asked Dec 24, 2023 in Sql by john ganales
0 votes
asked Jul 7, 2020 in Sql by Robindeniel
...