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
If you want to do this regulary
OPENQUERY
could be good, if you are moving not too much records per cycle.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', ...)