Question & Additional Information
 
What's the difference between DELETE TABLE and TRUNCATE TABLE commands in SQL?
Add to My IQ
 

Answer Title
Answer

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. TRUNCATE TABLE can be rolled back.

Question Tag Title
Tags
Question Asked At Title
Asked At
Question Job Title
Job Titles


Check out our newest job listings!

Post a Job! $49 for 60 days



Your Name:
Add your comment text
 
Related Questions
Related Questions
Flag this interview question as inappropriate Inappropriate
See Answer
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. Of course, TRUNCATE TABLE can be rolled back.
Create Date
:
Saturday, May 10, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
Create Date
:
Saturday, May 10, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
No. We cannot use truncate command on a table with Foreign Key because of referential integrity.
Create Date
:
Saturday, May 10, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
DELETE statement without a WHERE clause or the TRUNCATE TABLE statement. TRUNCATE TABLE is the most efficient way to delete all rows from a table. DELETE statement without a WHERE clause or the TRUNCATE TABLE statement. TRUNCATE TABLE is the most efficient way to delete all rows from a table.

Create Date
:
Wednesday, April 02, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
DELETE statement without a WHERE clause or the TRUNCATE TABLE statement. TRUNCATE TABLE is the most efficient way to delete all rows from a table. DELETE statement without a WHERE clause or the TRUNCATE TABLE statement. TRUNCATE TABLE is the most efficient way to delete all rows from a table.

Create Date
:
Wednesday, April 02, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Hashtable and HashMap are more less similar to each other except that the HashMap is unsynchronized and allows nulls whereas Hashtable is synchronized and does not permit nulls.
Create Date
:
Sunday, March 16, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
 
• More Related Questions: