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
Explain raiserror in sql server?
Can another user execute your local temporary stored procedures?
Can you import Microsoft Excel data to SSRS?
Explain how to use linked server?
How to call a function from a stored procedure in SQL Server ?
How to use "begin ... End" statement structures in ms sql server?
Do you know what is xpath?
What is scd (slowly changing dimension)? : sql server analysis services, ssas
what changed between the previous version of sql server and the current version? : Sql server database administration
Mention the differences between sql server and mysql.
How you can get a list of all the table constraints in a database? : Sql server administration
Does table partitioning improve performance?
What is normalization? Explain different forms of normalization?
do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
What is implicit mode in sql server?