Show and insert data in linked server from mysql to SQL Server

To show the data from a table in MYSQL database use below query syntax.

select * from openquery(LINKED_SERVE_NAME,'select * from mysqltable')

Example:

select * from openquery(MYSQL,'select * from tbl_name')

To insert sqlserver table data to mysqlserver table, use given query


insert OPENQUERY(LINKED_SERVE_NAME, 'select field_list from MYSQL_TABLE') 
select field_list  from SQL_TABLE

Example:

insert OPENQUERY(LINKED_SERVE_NAME, 'select name,add,lname from mysql_user') 
select  f_name,address,l_name from SQL_USER