Differencr Between DELETE and TRUNCATE?
Answers were Sorted based on User's Feedback
Answer / rajesh bhawsar
delete command, delete row by row and same time it makes an
entry in transaction log
while truncate remove the referance of respective
page/extent and doesn't make any entry in transaction log
truncate is faster then delete.
in case of truncate seed value (auto increment column) reset
to default unlike delete.
| Is This Answer Correct ? | 6 Yes | 1 No |
DELETE vs TRUNCATE
Check: http://sqlwithmanoj.wordpress.com/2009/02/22/difference-between-truncate-delete-and-drop-commands/
~Manoj
| Is This Answer Correct ? | 1 Yes | 0 No |
1) Delete command maintained the log files in each deleted row but truncate command do not maintained the log files for each deleted row but maintain the record for DE-allocation
of data-pages in the log files
2)Delete is a DML command and truncate is a DDL command.
3)Trigger is fired in case of delete command only but they are not fired when truncate command is used.
4)you can used where clause in case of delete command use to delete a particular row,
but you can not use where clause in case of truncate command use to delete a data from rows.
5) Truncate command reset the identity property to its initial values whereas delete command can not reset its identity property of its column.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are functions in the sql server?
What is the Query of getting last 10 transaction Reports (like insert, update, Delete Data from Tabele) ?
How many tables can be joined in SQL Server?
Consider the table T1 it consits A,2,3,4 consider another table t2 it contain 1,2a,3a,4a now i need o get the upadted answer
What stored by the master? : sql server database administration
What are the purpose of Normalisation?
What is updatable resultset?
What is difference between primary key and foreign key?
What is the difference between index seek vs. Index scan?
How to create a login account in ms sql server to access the database engine using "create login" statements?
What are trace flags and mention a few common trace flags used with sql server?
How can u get the number of pupils connecting the database?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)