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 is coalesce and check constraint in sql server?
hi, how to match retrieve the unmatched records from 2 tables in which we dont have any primary key. example : table1 has 1,2,3,4,5 and table2 has 1,2,3,4,5,6,7,8,9,10 and i want the numbers from 6 to 10 to be displayed and should not come as null. i need the numbers. please reply as soon as possible.
What is the name of the system variable that returns the number of rows affected by a SQL statement?
Explain use of expression builder.
Explain different types of collation sensitivity?
what is an extended stored procedure? : Sql server database administration
Where do we use trace frag?
What are the recovery models in sql server 2000?
How self join is different from outer join?
What is 2nf normalization form?
How to perfor If the table running time is taking 2hours and table is having 10 rows in it?
How do I view a stored procedure in sql server?
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)