34,589
社区成员
发帖
与我相关
我的任务
分享
for update
as
if update(amount)
if exists(select 1 from inserted where sign=23 and audit=1)
rollback
create trigger tr_t1
on t1 for insert ,update
as
begin
update t1 set amount=case when sign=23 and audit=1 then i.amount else 30 end
from inserted i where i.id=t1.id
and i.id=3 and i.amount=60
end
create trigger tr_t1
on t1 for insert ,update
as
begin
update t1 set amount=case when sign=23 and audit=1 then amount else 30 end
where exists(select 1 from inserted i where i.id=t1.id
and i.id=3 and i.amount=60)
end
update set amount=case when sign=23 and audit=1 then amount else 30 end
where id=3 and amount=60