反了. insert into 表B select * from 表A where title <>topic
insert into 表B select * from 表A where title <>topic
如果在一个serverinsert into 库A..表A select * from 库B..表B b where not exists ( select 1 from 库A..表A a a.title =b.topic )
如果是不同数据库: use 库B insert into tb select * from 库A..tb where title <>topic
哦,反了insert into 库B..表B select * from 库A..表A a where not exists ( select 1 from 库B..表B b a.title =b.topic )
如果在不同server,如果能够连通,则需要在B建立一个连接到A的链接服务器insert into 库B..表B select * from linkserverA.库A.dbo.表A a where not exists ( select 1 from 库B..表B b a.title =b.topic )
insert into 表B select * from 表A where title <>topic
select 1 from 库A..表A a a.title =b.topic
)
use 库B
insert into tb select * from 库A..tb where title <>topic
select 1 from 库B..表B b a.title =b.topic
)
select 1 from 库B..表B b a.title =b.topic
)