SQL trigger on Truncate

后端 未结 3 1151
旧巷少年郎
旧巷少年郎 2021-02-07 12:42

How to Fire a trigger when you do TRUNCATE (instead deleted) in MSSQL

3条回答
  •  粉色の甜心
    2021-02-07 13:28

    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).

提交回复
热议问题