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
Mention the differences between substr and charindex in sql server.
What are the key configuration files for sql server reporting services ?
How to enter comments in transact-sql statements?
What do we have to check in database testing?
Is sql server is free?
What are subqueries in sql server?
Explain the third normal form(3nf)?
What do you mean by authentication modes in sql server?
Find nth lowest salary or get nth lowest salary?
What is the new security features added in sql server 2016? : sql server security
What are different types of join?
what is an index? : Sql server database administration
What are the 2 types of classifications of constraints in the sql server?
What is the use of tempdb? What values does it hold?
What authentication modes does sql server support?