34,590
社区成员
发帖
与我相关
我的任务
分享
CREATE TRIGGER [abc] ON dbo.a
FOR INSERT
AS
begin
update b set aNum=aNum+(select count(1) from inserted where aid=b.aid)
return
error:
rollback transaction
end
update b set aNum=aNum+(select count(1) from inserted where aid=b.aid) where b.aid in (select distinct(aid) from inserted)
update b set aNum=aNum+(select count(1) from inserted where aid=b.aid)
where exists(select 1 from inserted where aid=b.aid)