create trigger tr_update on emp
for update
as
update salary set BASEPAY=a.BASEPAY+150
from salary a join inserted b on a.ENO=b.ENO
where b.TITLE='工程师'
for update
as
update salary set BASEPAY=a.BASEPAY+150
from salary a join inserted b on a.ENO=b.ENO
where b.TITLE='工程师'
for UPDATE AS
if UPDATE ( TITLE ) and exists( select 1 from inserted where TITLE = '工程师' )
begin
update salary set basepay = basepay + 150 from inserted where salary.eno = inserted.eno
end