触发器插入数据时修改当前插入的字段值sql server 2008

2024-11-24 09:00:19
推荐回答(1个)
回答1:

create Trigger table_InsertTrigger
on 表
for insert
as
if exists(select * from inserted )
begin
update 表 set c=a+b from 表 t where exists(select * from inserted i where i.a=t.a)
end