Delete

Truncate

Used to delete rows from a table based on the condition provided on the where clause. Used to delete the entire data from rows from the table. Similar to delete command with no where clause
 Delete commands deletes only the rows that are mentioned in where clause.

 

Truncate command deletes complete row from  a table.

 

We can roll back the delete commands.

 

We cannot roll back the truncate commands.

 

Delete command is very slow because it maintains a log

 

That’s why it is fast. This command is very fast as it does not maintain any log

 

It uses row lock when performing delete function

 

Truncate command uses table log while performing the truncate function

 

 

Categorized in: