Can you tell me the difference between DELETE & TRUNCATE
commands?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
What is public role in sql server?
What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?
Explain different forms of normalization?
Mention the 3 ways to get a count of the number of records in a table.
Explain DBCC?
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
Why use sub query in sql server and list out types of sub queries?
What are the functions in sql server?
What is the difference between a Application Server and a Database
What is forward - only cursors / read only cursor?
What are the different types of Indexes available in SQL Server?
What are the differences between lost updates and uncommitted dependencies?