create or replace trigger 触发器名
--表的更新后执行该触发器
after update on 表名
--每行更新时都触发该触发器
for each row
declare
-- local variables here
begin
--更新前的该字段值为0,更新后不为0
if :old.字段 = '0' and :new.字段 <> '0' then
/*update sql*/
end if;
end 触发器名;
追问谢谢您的热心帮助,不过我按照你的这个替换好像老是有一些错误 我把代码附上去你帮我看下哪里有错
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/902397dda144ad34c9416464d7a20cf430ad8553?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
追答if没写end if吧,还有就是update语句最后也没有分号,虽然没用过sqlserver,不过语法应该也得这么写吧。