Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between TRUNCATE and DELETE command
in SQL

Answer Posted / priya

Truncate an Delete both are used to delete data from the table. These both command will only delete data of the specified table, they cannot remove the whole table data structure.Both statements delete the data from the table not the structure of the table.
TRUNCATE is a DDL (data definition language) command whereas DELETE is a DML (data manipulation language) command.
You can use WHERE clause(conditions) with DELETE but you can't use WHERE clause with TRUNCATE .
You cann't rollback data in TRUNCATE but in DELETE you can rollback data.TRUNCATE removes(delete) the record permanently.

A trigger doesn’t get fired in case of TRUNCATE whereas Triggers get fired in DELETE command.

If tables which are referenced by one or more FOREIGN KEY constraints then TRUNCATE will not work.

TRUNCATE resets the Identity counter if there is any identity column present in the table where delete not resets the identity counter.

Delete and Truncate both are logged operation.But DELETE is a logged operation on a per row basis and TRUNCATE logs the deallocation of the data pages in which the data exists.

TRUNCATE is faster than DELETE.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi, I want to know basic information about Oracle HRMS and the institutes in hyderabad or the best faculty as i want to make my career in it.And also want to know may a person from non technical background be able to do this course. Regards, Swetha

2515


HOW TO SAVE UNIVERSES AND DOCUMENTS IN THE REPOSITORY?

2053


1. What is PO rate variance gain and loss?

2898


key flexfield structure

2166


which one is currently in used software cmpanies.

2137


what are basic modules required to implement oracle application in any oraganisation?

2197


what are the interface and api table for receipts conversion in oracle receivables? : oracle accounts receivable

1120


HOW TO GET THE ORGANIZATION TO ORGANIZATION DETAILS INFORMATION IN THE INVENTORY MODULE.THE REQUIREMENT IS FROMORG TOORG FROMINV TOINV ..

2504


What is the use of lockboxes? : oracle accounts receivable

1194


What is Tax Categories?

2104


how can we add a field to the oracle standard forms through Form Persanlization or custom.pll

2391


How do you create a credit note against an invoice? : oracle accounts receivable

1077


what is semphore explian it?

2801


What is the difference between recovery and restoring of the oracle database?

1206


What are the interface tables used for ar invoices, customers, receipts for conversion process? : oracle accounts receivable

1268