insert into A select * from B where not exists(select 1 from A where Md5_16=B.Md5_16)

解决方案 »

  1.   

    1、先导入同一个库里面,A B 两个表
    2、用语句合并到 C 表    select Md5_16,texts into c from a where 1=0 --建立 C 表
        --导入A表
        insert into c select * from a 
       --导入 b表中(a 表中不存在的记录)
        insert into c select * from b where Md5_16 not in (select Md5_16  from a) 
      

  2.   

    工具中使用
    select * from [test].[dbo].[md5] where not exists(select 1 from [md5].[dbo].[md5] where Md5_16=[test].[dbo].[md5].[Md5_16])
    直接导入成功了。