Delete, truncate, drop command in SQL
What is difference delete , truncate and drop command in SQL.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dhara Maheshwari5 reputationPosted Aug 28, 2012, 3:58 AM EDT
Truncate command deletes all the rows from table, but it doesn't delete the structure of table only the content of table,
drop command will remove the whole table in this table structure will also be deleted.
The priviledges, indexes created on table will also be deleted..
Drop and Truncate are DDL commands while Delete is DML command..
We can't rollback using Truncate, but we can rollback using DELETE..
Truncate is faster as compared to delete
U may also refer to below link:
http://www.orafaq.com/faq/difference_between_truncate_delete_and_drop_commands
R ACHUTHA181 reputationPosted Aug 28, 2012, 4:02 AM EDT
And delete command did not reset the identity value of the table. Truncate command reset the identity value of table that means if you truncate a table then if there is any identity value in the table it will reset to the initial value.
Drop command delete the entire table data and table schema.
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 28, 2012, 4:33 AM EDT
Any views or stored procedures depending on the dropped table must be explicitly dropped.
Delete removes rows from the table if a criteria is specified otherwise deletes all the rows. If it encounters foreign key constraint, it gets cancelled and will not delete row. it logs the individual row deletion.
Truncate deletes all the rows in the table and it does not log every row delete and so it is faster.