insert into db2.dbo.table1 select a.* from db1.dbo.table1 a left outer join db2.dbo.table1 b on a.id = b.id where b.id is null
--试用以下方法 use Datebase1 go insert into Database2..Table1(col1[,col2..coln]) select col1[,col2..coln]) from Table1 A where not exists(select 1 from Database2..Table1 where A.col1=col1 [and A.col2=col2.. and A.coln=coln])
select a.* from db1.dbo.table1 a
left outer join db2.dbo.table1 b on a.id = b.id
where b.id is null
use
Datebase1
go
insert into Database2..Table1(col1[,col2..coln])
select col1[,col2..coln]) from Table1 A where not exists(select 1 from Database2..Table1 where A.col1=col1 [and A.col2=col2.. and A.coln=coln])