What's the difference between DELETE TABLE and TRUNCATE
TABLE commands?

Answer Posted / skybeaver

"Delete TableName" is a logged transaction. Every row
affected by the delete will be written to the transaction
log. This is done for RECOVERY purposes, so that the
transaction may be rolled forward from a previous database
dump.

"Truncate TableName" is non-logged. It removes all rows
from the table and releases all allocated segments in the
database, all without logging anything. This is not
something a developer does, but rather is done by a DBA as
part of some sort of housekeeping.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the command dbcc checkdb used for?

530


How can we check the sql server version?

558


What is the tcp/ip port on which sql server runs?

564


Which are the olap features?

546


What are cursors in ms sql server?

593






Who is the owner of a schema in ms sql server?

544


Explain how to send email from sql database?

560


What is trace flag in sql server?

521


what are the different types of replication you can set up in sql server? : Sql server database administration

512


What is a benefit of using an after insert trigger over using a before insert trigger?

509


What are the recovery models for a database?

613


Is sql server implemented as a service or an application? : Sql server database administration

509


What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas

550


Explain four layers of abstraction microsoft architectured?

120


What are subqueries in sql server?

591