create trigger trigger_name
on table3
for insert
as
set nocount on
insert
table4
select
a.st,isnull(a.msg,b.msg),b.values
from
(select a.st, b.* from table1 a join inserted b on a.st=b.msg) a
full join
(select a.values, b.* from table2 a join inserted b on a.key=b.key) b
on a.key=b.key
set nocount off
on table3
for insert
as
set nocount on
insert
table4
select
a.st,isnull(a.msg,b.msg),b.values
from
(select a.st, b.* from table1 a join inserted b on a.st=b.msg) a
full join
(select a.values, b.* from table2 a join inserted b on a.key=b.key) b
on a.key=b.key
set nocount off
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货