1.建立链接服务器,select * into # from (select a.* from tb a union select b.* from serverb.tb b ) tbtest truncate table b insert into b select * from # drop # 2.在主键字段上建立唯一索引。这样所有重复的内容不可导入 3.写一约束,非主键字段全相同的只能出现一条。
select * from tabname1 except select * from tabname2
insert into 目标(*)select * from tabname1 except select * from tabname2
insert into table select * from (select * from tab1 union select * from tab2) aa
truncate table b
insert into b select * from #
drop #
2.在主键字段上建立唯一索引。这样所有重复的内容不可导入
3.写一约束,非主键字段全相同的只能出现一条。