How to Fire a trigger when you do TRUNCATE (instead deleted) in MSSQL
+3
A:
You can't do this on SQL server.
From MSDN
TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions. For more information, see CREATE TRIGGER (Transact-SQL).
David Hall
2010-02-10 03:32:46
A:
Are you letting users run TRUNCATE TABLE ad hoc / willy nilly? If not, instead of worrying about using a trigger, why not wrap the TRUNCATE command in a stored procedure that also deals with whatever the trigger would have done after the truncate finished? (But you'd have to do it in the opposite order, of course.)
Aaron Bertrand
2010-02-10 04:04:08