What is difference between TRUNCATE and DELETE statement

Answer Posted / nageswarao

truncate is used for deleting all data from table.
it is similar to delete command without condition.
main differences b/w delete & truncate are
1.truncate is faster in execution than delete which will
restructure the complete table without bothering of data.
where as delete checks the data row by row wrotes
information into log and deletes.
2.with truncate we cannot use any conditions

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the various types of concurrency problem?

962


Explain different types of index?

811


Does group by sort data?

710


What are the advantages of the mirroring?

829


What is precedence constraint?

756


What is set nocount on?

725


What is the use of nvl work?

775


How to use group functions in the select clause in ms sql server?

781


List the advantages of using stored procedures?

792


What is the usage of sign function?

837


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

761


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

875


What are approximate numeric data types in ms sql server?

811


How is sql server used?

736


How do you run a trace?

718