解答
即時同步兩個表的示例如下:
測試環境如下:SQL Sever
創建測試表
然後在本機上創建測試表
if exists (select * from dbo
drop table [test]
create table test(id int not null constraint PK_test primary key
go
create trigger t_test on test
for insert
as
set XACT_ABORT on
exec master
exec master
BEGIN DISTRIBUTED TRANSACTION
delete from openrowset(
where id in(select id from deleted)
insert into openrowset(
select * from inserted
commit tran
go
insert into test
select
union all select
union all select
union all select
union all select
union all select
union all select
delete from test where id in(
update test set name=name+
select * from test a full join
openrowset(
From:http://tw.wingwit.com/Article/program/Oracle/201311/17111.html