Can you tell me the difference between DELETE & TRUNCATE
commands?

Answers were Sorted based on User's Feedback



Can you tell me the difference between DELETE & TRUNCATE commands?..

Answer / pankaj kumar upadhyay

1) When we use delete command that time we will use
conditon or without conditon but when we use truncate
command so that time we will not use condition.

2)delete can roll back but truncate is not rollback.

3)Truncate is faster compare delete command.

4)delete is DML command while Truncate is DDL.

Is This Answer Correct ?    1 Yes 0 No

Can you tell me the difference between DELETE & TRUNCATE commands?..

Answer / afzal_aziz

http://weblogs.sqlteam.com/mladenp/archive/2007/10/03/SQL-
Server-Why-is-TRUNCATE-TABLE-a-DDL-and-not.aspx

Is This Answer Correct ?    2 Yes 3 No

Can you tell me the difference between DELETE & TRUNCATE commands?..

Answer / kapil

Delete: is a DML command.
Truncate: is a DDL command.

Delete & Truncate both can be rolled back.
Untill you have not commit transaction.

Is This Answer Correct ?    1 Yes 2 No

Can you tell me the difference between DELETE & TRUNCATE commands?..

Answer / amita

Delete command only delete the rows from the table but the
schema of the table yet remains.Whereas Truncate command
delete the rows along with the tale's schema from the
memory permanently.

Is This Answer Correct ?    3 Yes 28 No

Can you tell me the difference between DELETE & TRUNCATE commands?..

Answer / saradhi

Truncate command result can be rolled back as it is not
made an entry in the log where as Delete command result
can't be rolled back

Is This Answer Correct ?    5 Yes 47 No

Post New Answer

More SQL Server Interview Questions

Explain sub-query?

0 Answers  


Why I can not enter 0.001 second in date and time literals in ms sql server?

0 Answers  


What is transaction ? Give me one example.

11 Answers   Melstar, Wipro,


What are the different ways of moving data/databases between servers and databases in SQL Server?

3 Answers   HCL,


Define primary key?

0 Answers  






List the ways in which dynamic sql can be executed?

0 Answers  


What you can do to delete a table without the delete trigger firing?

0 Answers  


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

0 Answers  


Can we create SP inside SP ? If no Y ? If yes Y ? Explain with an example ?

3 Answers   IBM, L&T,


What are cursors? Explain the different types of cursors Enlist a few disadvantages of cursors.

0 Answers   Genpact,


difference between truncate, delete aur drop?

2 Answers  


Which is best Subquery (or) joins in sql server? explain why

2 Answers  


Categories