这是上次问的时候查到的
A库中的表t1
B库中的表t2
create trigger trgTest on t1
for update
as
update a
set des=b.des
from B.dbo.t2 a,inserted b
where a.tId=b.tIda是B.dbo.t2的别名b是inserted这个临时表的别名des应该是t1(t2)中的一个字段,拿来举例用的a.tid=b.tid,这个tid代表什么意思?请各位帮忙解释一下~thx~
A库中的表t1
B库中的表t2
create trigger trgTest on t1
for update
as
update a
set des=b.des
from B.dbo.t2 a,inserted b
where a.tId=b.tIda是B.dbo.t2的别名b是inserted这个临时表的别名des应该是t1(t2)中的一个字段,拿来举例用的a.tid=b.tid,这个tid代表什么意思?请各位帮忙解释一下~thx~
As
(此处省略500字)
As
truncate table B.dbo.t2
insert into b.dbo.t2
select * from t1
go
For Insert,Update,Delete
As
truncate table B.dbo.t2
insert into b.dbo.t2
select * from t1