When to user Truncate Delete in SQL?
Rathrola Prem Kumar
To delete all data
Truncate deals with MDF file Means permanent delete
To delete data from magic table also
Truncate delete with magic table Delete delete without magic table
Truncate query delete data with magi table also
to delete data with magic table from database we use truncate
1.TRUNCATE is a DDL command, whereas DELETE is a DML command.2.We can’t execute a trigger in case of TRUNCATE whilst with DELETE, we can accomplish a trigger.3.TRUNCATE is quicker than DELETE, for the reason that when we use DELETE to delete the data, at that time it store the whole statistics in the rollback gap on or after where we can get the data back after removal. In case of TRUNCATE, it will not store data in rollback gap. rub it out. TRUNCATE do not recover the deleted data.4.We can use any condition in WHERE clause using DELETE but it is not possible with TRUNCATE.5.If a table is referenced by any foreign key constraints, then TRUNCATE won’t work