• 触发器AFTER及FOR的区别


    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.
    INSTEAD OF
    Specifies that the DML trigger is executed instead of the triggering SQL statement, therefore, overriding the actions of the triggering statements. INSTEAD OF cannot be specified for DDL triggers.
    At most, one INSTEAD OF trigger per INSERT, UPDATE, or DELETE statement can be defined on a table or view. However, you can define views on views where each view has its own INSTEAD OF trigger.
    INSTEAD OF triggers are not allowed on updatable views that use WITH CHECK OPTION. SQL Server raises an error when an INSTEAD OF trigger is added to an updatable view WITH CHECK OPTION specified. The user must remove that option by using ALTER VIEW before defining the INSTEAD OF trigger.

  • 相关阅读:
    yum源及rpm、源码包
    iptables详解和应用
    Samba服务器设置
    FTP虚拟用户
    FTP服务器配置
    at 计划任务
    配置telnet服务
    C# 事件和委托的用途及区别
    C# socket——简单的TCP 服务端-客户端 连接通信
    检出的svn项目中的.idea文件夹可以删除
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/1592365.html
Copyright © 2020-2023  润新知