what is the difference between TRUNCATE and DELETE command
in SQL

Answer Posted / raja lakshmi reddy v

hi friends this is raja

Truncate:
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
possible.
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.
Delete:
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
thrown.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WHAT ARE TEMPLATES?EXPLAIN WHAT YOU HAVE CREATED?

1492


Which is the best institute in Hyderabad to learn OBIEE and DataStage?Please tell me faculty name also

1839


which one is currently in used software cmpanies.

1661


Is there any link between pr form(purchse requisition)and po form(purchase order)

2139


Hey i want to join oracle apps so will you pls tell me that which institute is best in hyderabad.

1842






i am pursuing mca and i want to do oracle apps technical in hydrabad, plz guide me tne best institue in hydrabad those have excellent knowledge in oracle apps.

1851


What do you mean by hz_ in customer tables? : oracle accounts receivable

642


What is chargeback invoice? How do we create it? : oracle accounts receivable

725


What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode in Oracle?

646


What do you mean by Oracle MEDIA RECOVERY?

723


difference of using cursor for loop and open,fetch,close.which one is better

1252


What Are Cross Validation & Adi?

689


What is auto accounting what are the steps for setting up auto accounting? : oracle accounts receivable

712


Could you please let me know the interfaces in OM / FA??

1734


while creating requisitions i am unable to see the list of organisation can anyone help me out ?

1704