a的ip是:192.168.0.1  
  b的ip是:192.168.0.2   
  a中的一个数据库为testA,表tableA 用户:sa, 密码:sa,123456

  b中的一个数据库为testB,表tableB 用户:sa, 密码:sa,123  
  
  现在要把tableB中的数据导出到tableA   
  insert into testA.dbo.db
  select * from openrowset('sqloledb','192.168.0.2';'sa';'123',testB.dbo.testB)  

  如果只导入id差异的数据:

  insert into testA.dbo.db (userId,userName,userPhoto)

  select userId,userName,userPhoto from openrowset('sqloledb','192.168.0.2';'sa';'123',testB.dbo.testB)
  where userId not in (
      select userId from testA.dbo.testA
  )  
  导入操作是要在b端执行!!!

  注意标点!!!

相关文章:

  • 2021-12-19
  • 2021-05-22
  • 2021-08-17
  • 2021-05-20
  • 2021-06-05
  • 2021-08-08
  • 2021-07-20
  • 2021-06-16
猜你喜欢
  • 2021-06-07
  • 2021-08-05
  • 2021-05-30
  • 2021-11-17
  • 2022-12-23
  • 2022-01-17
  • 2021-08-06
相关资源
相似解决方案