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 |
Explain error handling in ssis?
What is difference between unique and primary key?
What is cursor in ms sql server?
What are the new scripting capabilities of ssms? : sql server management studio
What is master database? : SQL Server Architecture
Psudo colums
What is the difference between IN and EXISTS operators in SQL Server?
9 Answers ASD Lab, CSC, Intelligroup,
Can you explain different types of locks in sql server?
How to set database to be read_only in ms sql server?
What is difference between primary key and foreign key?
What are the advantages of user defined function?
What is the order by used for?