[ACCEPTED]-SQL trigger on Truncate-tsql

Accepted answer
Score: 23

From msdn:

TRUNCATE TABLE cannot activate a trigger 2 because the operation does not log individual 1 row deletions.

Score: 9

You can't do this on SQL server.

From MSDN

TRUNCATE 4 TABLE cannot activate a trigger because 3 the operation does not log individual 2 row deletions. For more information, see 1 CREATE TRIGGER (Transact-SQL).

Score: 7

Are you letting users run TRUNCATE TABLE 7 ad hoc / willy nilly? If not, instead of 6 worrying about using a trigger, why not 5 wrap the TRUNCATE command in a stored procedure 4 that also deals with whatever the trigger 3 would have done after the truncate finished? (But 2 you'd have to do it in the opposite order, of 1 course.)

More Related questions