SQL Server Database Administrator Question:
Download Questions PDF

What is the difference between DELETE TABLE and TRUNCATE TABLE commands?

Answer:

DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back.

Download SQL Server DB Administrator Interview Questions And Answers PDF

Previous QuestionNext Question
What are different types of BACKUPs available in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?What is a major difference between SQL Server 6.5 and 7.0 platform wise?