zoukankan      html  css  js  c++  java
  • 触发器小练

    ALTER Trigger [dbo].[triVehicle] On [dbo].[OP_VehicleInfo]
    for insert
    As
    DECLARE @order int;
    DECLARE @outorder int;
    set @order = (select max(InSideSort)+1 from OP_VechileState) ;
    set @outorder = (select max(OutsideSort)+1 from OP_VechileState) ;
    INSERT into OP_VechileState select inserted.vehicleid,@order ,@outorder,'1',null from inserted

    、、、、、

    ALTER Trigger [dbo].[trdVehicle] On [dbo].[OP_VehicleInfo]
    for Delete
    As
    Delete dbo.OP_VechileState From dbo.OP_VechileState br , deleted d Where br.VehicleID=d.VehicleID
    Delete dbo.OP_Clean From dbo.OP_Clean br , deleted d Where br.VehicleID=d.VehicleID
    Delete dbo.OP_DutyInfo From dbo.OP_DutyInfo br , deleted d Where br.VehicleID=d.VehicleID
    Delete dbo.OP_Vacation From dbo.OP_Vacation br , deleted d Where br.VehicleID=d.VehicleID
    Delete dbo.OP_Maintain From dbo.OP_Maintain br , deleted d Where br.VehicleID=d.VehicleID
    Delete dbo.OP_VehicleBusinessInner From dbo.OP_VehicleBusinessInner br , deleted d Where br.VehicleID=d.VehicleID
    Delete dbo.OP_VehicleBusinessOuter From dbo.OP_VehicleBusinessOuter br , deleted d Where br.VehicleID=d.VehicleID

    、、、、、

    ALTER Trigger [dbo].[triVehiclestate] On [dbo].[OP_VechileState]
    for update
    As
    if update([state])
    begin
    update OP_VechileState set preState =d.state from OP_VechileState vs , deleted d where vs.VehicleId = d.VehicleId
    end

  • 相关阅读:
    ASIHTTPRequest详解
    UIViewController之间的相互跳转
    IOS延时加载网络图片
    ASI 实现注册方法的小例子(get和post方式)
    NSRange
    NSScanner
    序列化 NSKeyedArchiver,NSPropertyListSerialization
    自定义UITableViewCell
    UITableView去掉分隔符
    ASIHTTPRequest类库简介和使用说明(转)
  • 原文地址:https://www.cnblogs.com/sijiyong/p/3518624.html
Copyright © 2011-2022 走看看