+ 3
what is the exact difference between delete and truncate?
7 ответов
+ 7
delete will remove the data from the particular row..whereas truncate will remove all the data present in the table....for example there is a glass full of water. if we tilt the glass and drop some water it will be the delete command..now if we empty the glass it is called truncate command..and if we drop the glass it will be called the drop command which will remove the entire schema or we can say structure of the table...
+ 6
1. TRUNCATE is much faster than DELETE.
2. You can't rollback in TRUNCATE, but in DELETE you can. TRUNCATE removes the record permanently.
3. Trigger doesn't get fired in case of TRUNCATE. Trigger get fired in case of DELETE.
4. You can't use conditions (WHERE) in TRUNCATE in opposition DELETE.
+ 3
delete is used to remove data from your table & TRUNCATE is used remove all values from your table
+ 1
Truncate will just remove the data and keeps the schema...but delete will remove schema itself
0
DELETE will delete columns data from tables while truncate delets the whole table (or all columns from the table )
- 1
delete will delete whole table with its structure... but when you truncate structure remains same but inly values are removed
- 3
I don't know exactly what to do