我有如下一段代码,运行得到的结果是这样的,有会的大佬帮我看看问题出在哪了嘛alter trigger ui_value on t_martarget2--触发器对象表 for update ,insert--插入或更新时触发. as begin if EXISTS ( select 1 from t_martarget2 A ,inserted B where A.plants=B.plants and A.mattype=B.mattype and A.steps=B.steps )--检查插入或更新的数据在DIC_DATAupdate表中是否存在,有则更新,无则添加 update t_martarget2 set enddate=GETDATE() from inserted B where t_martarget2.plants=B.plants and t_martarget2.mattype=B.mattype and t_martarget2.steps=B.steps --为记录数据插入或更新时间,增加时间(lasttime)字段. insert into t_martarget2 select ,,,,getdate(),'2100-01-01' from inserted end