[ACCEPTED]-SQL trigger on Truncate-tsql
From msdn:
TRUNCATE TABLE cannot activate a trigger 2 because the operation does not log individual 1 row deletions.
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).
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
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.