SQL Server - 用于插入触发器

时间:2012-11-17 03:08:33

标签: sql-server

使用'For Insert'触发器,是否在触发时将行插入到表中?

  CREATE Trigger check_availability on Room
       For Insert, Update

谢谢!

1 个答案:

答案 0 :(得分:2)

CREATE TRIGGER

FOR | AFTER

    AFTER specifies that the DML trigger is fired only when all operations specified in the triggering SQL statement have executed successfully. All referential cascade actions and constraint checks also must succeed before this trigger fires.

    AFTER is the default when FOR is the only keyword specified.

    AFTER triggers cannot be defined on views.