zoukankan      html  css  js  c++  java
  • 如何调试触发器-MSSQL (转帖)

    调试触发器

    //-------------------------------------

    作者:四海为圈(原创)

    //-------------------------------------

    1、创建存储过程以便触发触发器

    3、选择单步运行存储过程

    2、在触发事件的语句如:insert 、update 、delete语句时按F11

     //-------------------------------------

    本方法在sql server 2000+win2000 server 通过测试

     本方法在vs.net 2003 + sql server 2000+win2000 server 通过测试

    //-------------------------------------

    GOOD

    转贴请注明来源

     维护网络道德是每个网民的义务

    //-------------------------------------

    实例教学:

     一、打开SQL查询分析器

     二、将以下Sql语句复制到查询窗口并运行

    use pubs

     CREATE  trigger trigger_update on authors

     for update

     as

     begin

      print('update lastname=hoho')

     end

     CREATE    proc Authors_procInsert

     as

     begin

      update  authors set au_lname='HOHO' where au_id='172-32-1176'

     end

    三、在左边的对象浏览器中选择pubs->存储过程在Authors_procInsert(如未出现请刷新pubs数据库)上右击弹出菜单选择“调试...”

    四、当运行到" update  authors set au_lname='HOHO' where au_id='172-32-1176'“时按“F11”即进入触发器代码

  • 相关阅读:
    用spring boot 来创建第一个application
    Entily实体类
    ORM
    lambda expression
    Domain logic approochs
    mysql的数据类型(Data type)
    Backup &recovery备份和还原
    spring AOP Capability and goals
    CDI Features
    Tomcat的配置与安装
  • 原文地址:https://www.cnblogs.com/xihong2014/p/4152666.html
Copyright © 2011-2022 走看看