Thursday, October 30, 2008

TRUNCATE TABLE AND DELETE TRIGGER

When DELETE FROM ... is executed it will call the DELETE triggers[if any on the table].On the other hand if you call TRUNCATE TABLE .. to remove the records, it will not fire the DELETE triggers.
Usually TRUNCATE is used for administrative purposes and is the quick way to clean the table retaining the table structure.So keep this is mind when you are issuing TRUNCATE from your application and the physical table has delete triggers.

No comments: