What is the diff between Truncate table / delete <table
name> purge
Answer Posted / d.elumalai
DELETE:
1.DML Command.
2. Can be used with WHERE clause.
3. Can be rolled back.
4. Deletes table contents row by row when executed.
5. Delete is slow
6.Doesn't frees-up the Storage Space
7.Creates the log file
8.Returns the no. of rows deleted when queried.
9. Trigger gets fired incase of Delete.
10. Date gets copied into the Rollback tablespace after
Delete is executed.
TRUNCATE:
1.A DDL Command,
2.Can't be used with WHERE clause.
3.Can't be Rolled back.
4.Drops the entire table contents when executed but not the
table. [Note:DROP commnad deletes the entire contents along
with the table]
5.Truncate is faster.
6.Frees-up the Stroage Space
7. Doesn't create a log file
8.Doesn't return the no. of rows deleted when queried.
9.Trigger doesn't get fired incase of Truncate.
10.Data gets romoved directly without copying it into the
Rollback tablespace when truncate is executed.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is Materialized View? In What Scenario we Use Materialized View?
how to calculate the difference between two dates? : Sql dba
what is bcp? When is it used?
explain mysql aggregate functions. : Sql dba
what is subquery? : Sql dba
What is having clause in sql?
Explain correlated query work?
What will you get by the cursor attribute sql%rowcount?
How does one use sql*loader to load images, sound clips and documents? : aql loader
What is the sql query to display the current date?
what are the differences between binary and varbinary? : Sql dba
What are transaction and its controls?
Can we commit inside a trigger?
How many rows can sqlite handle?
What is the difference between Union and Union all. Which is faster.