Differencr Between DELETE and TRUNCATE?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to return the second 5 rows in ms sql server?

642


How many categories of data types used by sql server?

602


How to verify a user name with sqlcmd tool?

593


What is #temp and @table variable in SQL server?

597


Explain “@@rowcount” and “@@error” in sql server?

547






Explain microsoft sql server functions?

553


Explain about system stored procedure?

609


What are window functions in sql server?

520


How to automatically create a log when an exception is being received into SQL Server?

748


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1638


What are the new features are introduced in sql server 2012 reporting services?

109


State the difference between union and union all?

529


What is serializable?

675


Explain what are various ways to enhance the ssrs report?

582


Explain about service Broker functions?

623