Compare and contrast TRUNCATE and DELETE for a table.
Answers were Sorted based on User's Feedback
Basically truncate is a DDL and Delete is DML. You can use
delete to remove rows depending on certain criteria and it
generated redo logs and can be rolled back before you
commit the transaction, Where as the truncate is used to
remove all the data in the table. Once you execute this
command u can not rollback this transaction.and commit is
not required for the truncate statement
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / taral desai
truncate is faster then delete... truncate don't generate
rollback. truncated data can't be recovered
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / amsu
Truncate is a DDL and delete is a DML command. Once you
truncate a table you cannot rollback where as you can
rollback from the delete command. When you truncate a
table it release the space and it resets the highwater
mark. Delete won't release the space and it won't resets
the highwater mark.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sridhar
truncate and delete are deltes all rows in the table but truncate is much faster than delete.
and if u delete row in the delte deletion of each gets logged in the transaction log.
truncate there is no way to log in transaction log
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / kishore
truncate removes all the rows from a table
it can't be rollback
delete removes all /specific rows from a table
it can be rollback
drop removes whole table
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / monal
IN MSSQLSERVER TRUNCATE RESETS IDENTITY VALUE OF COLUMN
WHILE DELETE DOESN'T RESETS IDENTITY VALUE OF COLUMN
| Is This Answer Correct ? | 0 Yes | 1 No |
Explain an ORA-01555
what functionality does oracle provide to secure sensitive information?
what is the purpose of catlaog in oracle rman?
what do you understand by flashback feature of oracle?
Can you tell me about your experience with the administration of COTS system..? Also, how do you set up seed data..?
Give the reasoning behind using an index.
How would you begin to troubleshoot an ORA-3113 error?
How can you gather statistics on a table?
Can we take incremental backups in datapump?
suppose you want to audit specific activities on sensitive data. How can you achieve that?
How to craeate the New Database Schema in Oracle and mysql? Please tell me with Example?
What are the different sql server versions you have worked on? : sql server DBA
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)