What is difference between TRUNCATE and DELETE statement
Answer Posted / archana motagi
Both the operations can be rolled back.The difference is,
DELETE TABLE is a logged operation, so the deletion of each
row gets
logged in the transaction log, which makes it slow.
TRUNCATE TABLE
also deletes all the rows in a table, but it won't log the
deletion of
each row, instead it logs the deallocation of the data
pages of the
table, which makes it faster.
| Is This Answer Correct ? | 17 Yes | 4 No |
Post New Answer View All Answers
Which is the latest version of sql server and when it is released?
How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?
What is triggers and its types?
Difference between report and query parameter. Why do we need different type of parameter?
How is foreign key related to primary key?
What happens if date-only values are provided as date and time literals?
What is difference between table aliases and column aliases? Do they affect performance?
How to add a new column to an existing table with "alter table ... Add" in ms sql server?
What action plan is preferred if sql server is not responding?
How to create a store procedure with encryption?
User wants only to display only pdf as export option in report manager. How to achieve this?
What is the difference between writing data to mirrored drives versus raid5 drives
What is a covering index?
What are the different types of Indexes available in SQL Server?
Define inner join? Explain with an example?