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
How to maintain a fill factor in existing indexes?
How to create a store procedure with encryption?
wat wil hapn if we give the both read and deny read permission to user?
Can we store videos inside the sql server table?
What is normalization 1nf 2nf 3nf?
What is the difference between dataadapter and datareader?
How to use order by with union operators in ms sql server?
what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration
What is the difference between executequery () and executeupdate ()?
Which is faster statement or preparedstatement?
What is the command dbcc checkdb used for?
What does this statement do @@rowcount?
How do triggers work?
What is the return type of executeupdate ()?
What are the instances when triggers are appropriate?