Inserting from MS SQL Server to MySQL database

前端 未结 1 358
旧巷少年郎
旧巷少年郎 2021-01-04 13:25

I want to create a stored procedure that INSERTs data from the MSSQL DB tables to my MySQL DB tables and vice versa. What do I need to do this?

I have looked into tw

相关标签:
1条回答
  • 2021-01-04 14:01

    If you want to do this regulary

    • LinkedServer and OPENQUERY could be good, if you are moving not too much records per cycle.
    • Integration Services Package is a good solution if you want to move lots of data (like thousands or millions of rows).

    You can schedule them with SQL Server Agent.

    The INSERT is a bit tricky with OPENQUERY:

    INSERT INTO OPENQUERY (MYSQL, 'SELECT * FROM MySQL_Table')
    SELECT * FROM dbo.SQLServer_Table
    

    OR

    INSERT INTO OPENQUERY (MYSQL, 'SELECT * FROM MySQL_Table')
    VALUES ('Value1', 'Value2', ...)
    
    0 讨论(0)
提交回复
热议问题