+ 1

What is the difference between delete and truncate can any one explain?

2nd Aug 2016, 2:05 AM
Sudhakar Kathiresan
Sudhakar Kathiresan - avatar
4 odpowiedzi
+ 6
delete statement is used to delete a row or multiple rows or the entire rows from a table truncate is used to delete the entire rows from a table and primary key is reset to the initial value that is set.
2nd Aug 2016, 12:06 PM
Aravind R S
Aravind R S - avatar
0
truncate is to delete all rows in a table but not the table itself. delete statement is to delete a single or multiple selected rows.
18th Aug 2016, 4:38 PM
Abiodun Olufemi Bayowa
Abiodun Olufemi Bayowa - avatar
0
truncate Removes all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.
21st Aug 2016, 1:56 PM
Emad Al Hawary
Emad Al Hawary - avatar
0
Truncate table- it will clear identity (autoincrement starts from zero) value and delete all data in the table. Delete -it will only delete data from table if any where condition specified then it will only delete that specific data
11th Sep 2016, 7:30 AM
Sreejith