+ 1
What is the difference between delete and truncate can any one explain?
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.
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.
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.
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