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.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
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
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
No. We cannot use truncate command on a table with Foreign Key because of referential integrity.
Create Date
:
Saturday, May 10, 2008
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
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
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
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
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
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
Click here
to improve the Interview Question, Answer and other fields.