DELETE vs TRUNCATE | DELETE Command | TRUNCATE Command | #TechPointFundamentals

DELETE vs TRUNCATE | DELETE Command | TRUNCATE Command | #TechPointFundamentals Agenda: --------- Q01. What is the difference between DELETE and TRUNCATE in SQL? Q02. Is it true that DELETE can be rolled back, but TRUNCATE can’t be rolled back? Q03. Is it true that DELETE can be restored back, but TRUNCATE can’t be restored back? Q04. Is it true that TRUNCATE TABLE is non-logged? Q05. Can you recover the deleted records from the Table? Q06. What is LSN (Log Sequence Numbers) in SQL? Q07. What is DELETED Table in SQL? Difference: ----------- 1. DELETE is the DML command and TRUNCATE is the DDL command. 2. DELETE deletes records one by one, whereas TRUNCATE de-allocates pages at one go. 3. TRUNCATE resets the IDENTITY back to the SEED while DELETE does not. 4. You require delete permission on a table to use this. You require Alter table permissions to truncate a table. 5. You can use the Delete statement with the indexed views, but TRUNCATE cannot be used.
Back to Top