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 difference between TRUNCATE and DELETE statement

Answer Posted / manub22

–> DELETE:

1. Removes Some or All rows from a table.
2. A WHERE clause can be used to remove some rows. If no WHERE condition is specified, all rows will be removed.
3. Causes all DELETE triggers on the table to fire.

–> TRUNCATE:

1. Removes All rows from a table.
2. Does not require a WHERE clause, so you can not filter rows while Truncating.
3. IDENTITY columns are re-seeded on this operation, if no seed was defined then the default value 1 is used.
4. No Triggers are fired on this operation because it does not operate on individual rows.

Check more differences b/w DELETE & TRUNCATE here: http://sqlwithmanoj.com/2009/02/22/difference-between-truncate-delete-and-drop-commands/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Relational calculus is what type of language?

1038


What is the difference between ‘having’ clause and a ‘where’ clause?

1041


Explain trigger classes i.e. Instead of and after trigger?

883


What does COMMIT command do?

1067


Define full outer join in sql server joins?

998


tell me what is blocking and how would you troubleshoot it? : Sql server database administration

905


Is sql server a database?

1003


What is sql server schema compare? How we can compare two database schemas?

1033


What is a dbms wizard?

1022


How to declare and use cursor variables?

1172


How to get @@error and @@rowcount at the same time?

1035


Why is sql server log file full?

1040


what are cursors? : Sql server database administration

1064


What is the use of “join” in sql server?

1099


Difference between primary key and clustered index?

1012