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
What are different types of table joins?
What is the order by used for?
Do you know what are the restrictions that views have to follow?
What are some examples of schemas?
What is b tree index?
What happens if we shrink log file in sql server?
What are the differences between DDL, DML and DCL in SQL?
Explain how to use linked server?
where the connection string store in the database
Why I am getting this error when dropping a database in ms sql server?
What type of Index will get created after executing the above statement?
How do you create a data source?
What is local temp table?
What is data source document?
What is indexing a document?