Differencr Between DELETE and TRUNCATE?

Answers were Sorted based on User's Feedback



Differencr Between DELETE and TRUNCATE?..

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

Differencr Between DELETE and TRUNCATE?..

Answer / manoj pandey

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

Differencr Between DELETE and TRUNCATE?..

Answer / wasimali

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

Post New Answer

More SQL Server Interview Questions

how to get the salary in descending order with out using the keyword desc in sql

5 Answers   Ramco,


If i have one transaction say mainTransaction, within this mainTransaction i have another two transaction say t1 and t2. Now while execution t1 completes successfully and commit statement fires, but while executing t2 some error occurs and rollback statement fires. What happen to t1, is it rollback or not?

1 Answers   Ness Technologies,


How to find the date and time of last updated table?

3 Answers  


What structure can you implement for the database to speed up table reads?

1 Answers  


What is key attribute?

1 Answers  


What is mean by "fill factor" ? and what is mean by "Index "in sql?

1 Answers   iGate, Logica CMG,


What is set nocount on?

1 Answers  


What are the differences between triggers and stored procedures?

1 Answers  


What is a SQL Server Temporary Table?

1 Answers   Wipro,


What is the status of services on passive node for failover cluster in sql server? : sql server database administration

1 Answers  


Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.

1 Answers   Global Logic,


Can we add our custom code in ssis?

1 Answers  


Categories