34,594
社区成员
发帖
与我相关
我的任务
分享
create trigger trig_update
on table1
for update
as
begin
if update(tt1_1) or update(tt2_2) begin
insert into table3 select no,1 from inserted i where exists(select 1 from table2 where tt = i.tt1)
insert into table3 select no,2 from inserted i where exists(select 1 from table2 where tt = i.tt2)
end
end
go
create trigger trig_update
on table1
for update
as
begin
if update(tt1_1) or update(tt2_2) begin
insert into table3 select no,1 from inserted i where exists(select 1 from table2 where tt = i.tt1
insert into table3 select no,2 from inserted i where exists(select 1 from table2 where tt = i.tt2
end
end