How to transfer data from one table to another on different servers

0

I need to copy the records of a table that is in a MySQL linked server to SQL Server, ie transfer the records from one server to the other. Could someone give me a way to do this through a query ?

    
asked by anonymous 17.07.2018 / 19:29

1 answer

1

From mysql to sql-server you can do this:

UPDATE tabela SET campo=A.campo FROM
(SELECT * FROM OPENQUERY(nome-linked-server,'Select * From tabela')) A
  INNER JOIN join tabela B on b.Id=a.Id

You must enter the name of the link in the OPENQUERY , and do the joins. In the example I used the alias "A".

    
17.07.2018 / 19:56