What's the difference between DELETE TABLE and TRUNCATE
TABLE commands?

Answer Posted / nageswarao

1.truncate is DDL cmd.where as delete is a DML cmd.
2.truncate is similar to delete command without no
condition.
3.when u use truncate it restructure the table,wthout
bothering of data it deletes entire records.
but,delete is a logged transaction.before delete
records it copies to transaction log.then removes.
4.truncate take less time than delete in execution.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by an execution plan? Why is it used? How would you view it?

712


What is difference between index and primary key?

804


what is the maximum size of a row? : Sql server database administration

714


How are the exceptions handled in sql server programming?

763


What is the difference between varchar and varchar types?

751


What is the purpose of self join?

675


Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

700


What does it mean to invest in the index?

703


Why we need sql server?

718


How to modify an existing user defined function?

781


In which format does an image save in SQL Server database ?

788


Can an entity have two primary keys?

729


Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

713


What are scheduled tasks in sql server?

740


What are triggers? How do you invoke a trigger on demand?

981