After select the table from one server and how to insert into another server?

后端 未结 2 1792
梦谈多话
梦谈多话 2021-01-20 12:14

I have two servers and I need to transfer all the details of a particular user from one server to another server.

I selected row from one server and now I have to in

相关标签:
2条回答
  • 2021-01-20 12:27

    You need to define linked server in SQl server. For example LN that you can insert to the linked database. LN.dbo.table . In your store procedure you can insert into linked table

    0 讨论(0)
  • 2021-01-20 12:28

    USE full qualified name like

            INSERT INTO  SERVER1.DATABASE1.dbo.TABLE1  values(SELECT * FROM SERVER2.DATABASE2.dbo.TABLE2)
      
    make sure that no. of columns and dataType should be same of those two tables and order of column value should be same .

    0 讨论(0)
提交回复
热议问题