What is difference between TRUNCATE & DELETE?

Answer Posted / swapnareddy

Main Differences between Truncate and Delete:
Truncate:
1:Truncate removes all records but using this we cannot
remove a particular record.
2:Truncate is ddl command(data definiton language command)
3:Rollback cannot be done when we use this command.
4:Truncate cannot fire a trigger.
Delete:
1:delete can remove all records or a particular record.
2:delete is a dml command(data manipulation language command)
3:rollback is possible when we use this command.
4:delete can fire a trigger

Is This Answer Correct ?    19 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between partitioning and sharding?

523


Is join same as left join?

523


how mysql optimizes distinct? : Sql dba

549


Is it possible to read/write files to-and-from PL/SQL?

650


What is sql partition function?

610






how to select first 5 records from a table? : Sql dba

507


Why triggers are used?

551


Why is partition used in sql?

545


What is a pl/sql block?

588


Explain the purpose of %type and %rowtype data types with the example?

549


What is substitution variable?

574


What is the difference between the repeatable read and serializable isolation levels? : Transact sql

528


What is numeric function sql?

536


What is the advantage of index in sql?

534


Why do we need a foreign key?

543