crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

7 difference between Truncate and delete
Question Posted on 27 Jul 2011Home >> DataBase >> sql questions >> 7 difference between Truncate and delete

TRUNCATE is faster due to its usage of system and transaction log resources is less than DELETE.
delete is less faster then truncate.

One another reason why TRUNCATE is faster that itremoves the data by deallocating the data pages used to store the tables data and only the page deallocations are recorded in the transaction log.
DELETE removes rows in sequence means one at a time and stores an entry in the transaction log for each deleted row so it usage is greater then the truncate.

TRUNCATE removes all the rows from a table without effecting table structure, columns, constraints, indexes.But the counter used by an identity for new rows is reset to the seed for the column.
DELETE does not reset Identity property of the table.

We cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint.
Delete is same as Truncate table but we can activates Triggers if defined on table.

DELETE can be used with or without a WHERE clause
In Truncate it is not applicable

TRUNCATE cannot be rolled back but we can do this by using TRANSACTION OR TRUNCATE.
DELETE can be rolled back.

TRUNCATE is a DDL Command.
DELETE is DML Command.
0
0



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

Define N in nvarchar and in nchar?

difference between drop and truncate command

difference between procedure and function

different types of databases in sql

Difference Between Update Lock and Exclusive Lock






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap