编写简单的触发器运行结果不行
为表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
请教啊!!!!