--即时同步两个表的实例:
--测试环境:SQL2000,远程主机名:xz,用户名:sa,密码:无,数据库名:test
--创建测试表,不能用标识列做主键,因为不能进行正常更新--在本机上创建测试表,远程主机上也要做同样的建表操作,只是不写触发器if exists (select * from dbo.sysobjects where id = object_id(N'[test]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [test]
create table test(id int not null constraint PK_test primary key ,name varchar(10))go
--创建同步的触发器create trigger t_test on testfor insert,update,de......
阅读全文