sql中简单触发器案例
来源:互联网 发布:普通专升本网络课程 编辑:程序博客网 时间:2024/05/21 09:32
create trigger tri_zl_lx
on ZL_LX for update
as
if update(ZL_lx_score)
begin
update ZG_ZL
set ZG_ZL.Score4=inserted.ZL_lx_score*CG_JS.xi_shu
from inserted,ZG_ZL,ZL,CG_JS
where ZG_ZL.ZL_id=ZL.ZL_id and ZL.ZL_lx_id=inserted.ZL_lx_id and CG_JS.rank=ZG_ZL.F_G4 and CG_JS.num=ZL_rs
on Z_LB for update
as
if update(Z_LB_score)
begin
update ZG_Z_ZUO
set ZG_Z_ZUO.Score3=inserted.Z_LB_score*CG_JS.xi_shu *Z_ZUO.Z_words
from inserted,ZG_Z_ZUO,Z_ZUO,CG_JS
where ZG_Z_ZUO.Z_id=Z_ZUO.Z_id and Z_ZUO.Z_LB_id=inserted.Z_LB_id and CG_JS.rank=ZG_Z_ZUO.F_G3 and CG_JS.num=Z_ZUO.z_rs
end
on SL for update
as
if update(SL_score)
begin
update ZG_LW
set ZG_LW.Score=(inserted.SL_score+KW_score)*CG_JS.xi_shu
from KW_JB ,inserted,ZG_LW,L_W,CG_JS
where ZG_LW.LW_id=L_W.LW_id and L_W.KW_id=KW_JB.KW_id and L_W.SL_id=inserted.SL_id and CG_JS.rank=ZG_LW.F_G and CG_JS.num=LW_rs
end
on ZL_LX for update
as
if update(ZL_lx_score)
begin
update ZG_ZL
set ZG_ZL.Score4=inserted.ZL_lx_score*CG_JS.xi_shu
from inserted,ZG_ZL,ZL,CG_JS
where ZG_ZL.ZL_id=ZL.ZL_id and ZL.ZL_lx_id=inserted.ZL_lx_id and CG_JS.rank=ZG_ZL.F_G4 and CG_JS.num=ZL_rs
end
on Z_LB for update
as
if update(Z_LB_score)
begin
update ZG_Z_ZUO
set ZG_Z_ZUO.Score3=inserted.Z_LB_score*CG_JS.xi_shu *Z_ZUO.Z_words
from inserted,ZG_Z_ZUO,Z_ZUO,CG_JS
where ZG_Z_ZUO.Z_id=Z_ZUO.Z_id and Z_ZUO.Z_LB_id=inserted.Z_LB_id and CG_JS.rank=ZG_Z_ZUO.F_G3 and CG_JS.num=Z_ZUO.z_rs
end
on SL for update
as
if update(SL_score)
begin
update ZG_LW
set ZG_LW.Score=(inserted.SL_score+KW_score)*CG_JS.xi_shu
from KW_JB ,inserted,ZG_LW,L_W,CG_JS
where ZG_LW.LW_id=L_W.LW_id and L_W.KW_id=KW_JB.KW_id and L_W.SL_id=inserted.SL_id and CG_JS.rank=ZG_LW.F_G and CG_JS.num=LW_rs
end
- sql中简单触发器案例
- SQL Server 中 触发器 简单示例
- PL/SQL中触发器的简单使用
- 拿来主义:SQL数据库中触发器的应用案例
- sql-server 简单触发器
- SQL触发器简单用法
- SQL触发器简单实例
- oracle中简单的sql执行的表、序列、触发器
- oracle存储过程及触发器简单案例
- sql数据库中触发器
- sql中建触发器
- SQL中触发器
- SQL server中的简单触发器
- SQL server触发器简单示例
- 触发器案例
- sql中触发器实例讲解
- 在SQL中创建触发器
- sql中触发器的使用
- 来自微软一站式脚本示例库的两个相当流行的Windows 8 脚本示例
- RTTI
- 【设计模式】【策略模式 打折算法】
- 多媒体封装格式详解(01) MP4
- jQuery乱谈(七)
- sql中简单触发器案例
- ApacheBench(ab)详解
- 《思考的技术》笔记三
- 现代浏览器的工作原理
- aix6.1安装jdk 1.7
- kmp算法
- windows xp下vmware中成功安装MAC OS LION
- linux ftp设置
- wince下钩子的使用-实时捕获按键消息