标题:编写简单的触发器运行结果不行
取消只看楼主
那个梦
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-11-7
 问题点数:0 回复次数:2 
编写简单的触发器运行结果不行
为表T创建一触发器:当职称从“讲师”晋升为“副教授”时,岗位津贴自动增加500元:从“副教授”晋升为“教授”时,岗位津贴自动增加900元。

create trigger update_teacher6 on teacher
for update
as
if update(prof)
declare @tno_new char(6), @tno_old char(6),
@prof_new char(12), @prof_old char(12)
select @tno_new =tno,@prof_new=prof from inserted
select @tno_old =tno,@prof_old=prof from deleted
if exists(select * from deleted
where @prof_old='讲师')
begin
update teacher
set comm=comm+500
where tno=@tno_old
end

请教啊!!!!
搜索更多相关主题的帖子: prof 触发器 tno old char 
2007-11-08 08:59
那个梦
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-11-7
得分:0 
请大家来帮忙啊..
2007-11-08 09:09
那个梦
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2007-11-7
得分:0 
谢谢你的解答阿!
2007-11-08 18:33



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-184415-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.442664 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved