what is the difference between TRUNCATE and DELETE command
Answers were Sorted based on User's Feedback
Answer / guest
Truncate command cannot be rolled back while Delete can be
|Is This Answer Correct ?||178 Yes||18 No|
Answer / pavan_1981
truncate is ddl command.its faster than delete as it doesnt
have go through the rollbacks etc.truncate being a ddl is
auto commit.we can only truncate the whole table(cant use
where clause).once table is truncated we cant rollback the
changes.when a table is truncated the memory occupied is
released.that id the water mark is adjusted.
delete is a dml command and can be rolled back.is slower
than truncate as it is dml has to go through rollback
segments etc.we can use where clause with delete.when a
table is deleted memory occupied is not released ans also
the water mark is not adjusted.
|Is This Answer Correct ?||153 Yes||11 No|
Answer / mkjmkumar
1. It is DDL.
2. Speed is faster
3. Do not Check Constraints.
4. Roll Back is not possible.
5. Can not use where clause
1. It is not a DDL
2. Speed is slow
3. Check constraints, If Exists then shoe error.
4. We can rollback .
5. User Where Clause
|Is This Answer Correct ?||78 Yes||8 No|
Answer / kotravel. b
1 cannot be 1 can ba RB
2 faster than 2 slower than truncate
3 it releses the stroge 3 it does not releses the stroge
|Is This Answer Correct ?||75 Yes||8 No|
Answer / nithya
The delete statement will result in the table spaces or
memories would remain as the current size and table
structure remain in the database. Delete is not effective
when you use it to remove all data from a table, because it
takes up storage spaces due to unclear memories.
The truncate statement will result in clearing table spaces
or memories and the table structure remain in the database.
Therefore it free table storage spaces and use it only when
you need to remove all data from a table.
|Is This Answer Correct ?||24 Yes||3 No|
Answer / anup.wilson
hii every one ... i want to say that delite is --dml and
truncate is ddl ..nxt thing about roll back ..through
delete we roll back untill unless we are not COMMIT IT..
IF WE COMMIT AFTER DELETE ..WE CANT ROLL BACK IT
|Is This Answer Correct ?||15 Yes||3 No|
Answer / dheeraj
Delete is DML Command ,Whereas Trucate is DDL command
Delete can be Rolled Back,Truncate cannot be rolled back,
Truncate is much faster then Delete
Delete will not released the memory space ,Memories would
be same if we use delete command the structure of the
table is still there
Trncate can be free the space in the meomory
Delete , use check constraints if exits then show error
Truncate don't use check constraint
|Is This Answer Correct ?||13 Yes||4 No|
1.Truncate Can be DDL Command.
2.it cannot be rollback.
3.we cann't use Where clause.
4.truncate=delete+commit so we cann't rollback.
5.truncate delete all record from the table.
6.truncate is a DDL command and cannot be rollbackand all
memory space is released back to server.
8.do not chcek constraint.
1.Delete Can be DML Command.
2.it can be rollback.
3.we can use Where clause.
4.delete=delete-- so we can be rollback.
5.delete delete record from the table.
6.truncate is a DDL command and can be rollback and all
memory space is not released back to server.
8. chcek constraint.
|Is This Answer Correct ?||14 Yes||7 No|
Answer / kavita sahu
1. Truncate is a DDL command and delete is a DML command
2. Truncate delete all records from table there is no
ROLLEDBACK it always Commit without giving the Commit
3. Truncate is much faster than Delete
4. Truncate you can't use where clause
DELETE you can use where clause
|Is This Answer Correct ?||4 Yes||0 No|
Answer / raja lakshmi reddy v
hi friends this is raja
1. Truncate is used to delete all rows at a time, so the
table will become as free. The user feel the table does not
contain any rows, eventhough but internally the data exist
some memory that memory is free for our reuse.
2. Truncate is faster than delete, and where clause never
3. It is ddl command so that it will not roll back because
auto commit by default.
4. in sqlserver autoid columns will reset since from
starting seed value.
1. Delete is used to Delete particular rows or all with
where clause or without where clause.
2. remeber if u delete rows, eventhough that memory will
never free means separate memory will allocate to our table.
3. It is slower than the truncate.
4. in sqlserver autoid values will never start from seed
intial value or default value.
5. while deleting check constrains, if any problem errow
|Is This Answer Correct ?||6 Yes||3 No|
How would you go about increasing the buffer cache hit ratio?
Explain the use of table functions.
what is the difference b/w oracle8i and oracle9i
How would you determine the time zone under which a database was operating?
What are different types of receipt reversals ? Explain them : oracle accounts receivable
What is database schema?
How do you resize a data file?
Whats the purpose of using Nextval while creating the sequence.
I need a Technical evaluation between Oracle and SAP ? please do a need ful.
as a technical developer in oracle applications which type errors feced in your experience sofar
What is the mandatory setup in cyclecount ?
How would you force a log switch?