We have been successfully copying data from a MySQL Slave database into a MSSQL database. The MySQL server is a linked server. I have tried using v3.51 and v5.1.8 of the ODBC connector provided my MySQL.
Simply trying to insert into a temporary table in MSSQL from a table in MySQL using OPENQUERY causes the following error:
Server: Msg 7391, Level 16, State 1, Line 1
The operation could not be performed because the OLE DB provider 'MSDASQL' was unable to begin a distributed transaction.
[OLE/DB provider returned message: [MySQL][ODBC 3.51 Driver]Optional feature not supported]
OLE DB error trace [OLE/DB Provider 'MSDASQL ' ITransactionJoin::JoinTransaction returned 0x8004d00a].
This error started happening when replication between the MySQL master and slave failed. This has since been fixed but the error above persists.
The MSSQL Server is running on a Windows 2003 R2 Server and the MySQL servers are running on CentOS 5 servers, the two servers are in different datacenters and talk to each other via OpenVPN.
Is there something more that needs to be done on the MySQL side? Any suggestions for the MSSQL side? I have already tried restarting DTC as well as rebooting the server.
Thanks
Finally solved this problem. Please see post in this Stack Overflow article: SQL Server 2000 - Linked Server
If using explicit command "EXECUTE", make sure that the Linked Server does not have any transactions open. For Example:
BEGIN TRANSACTION
SP_CALL_LINKED_SERVER
...
In SP_CALL_LINKED_SERVER you cannot call any transaction (Ex: ...EXECUTE (LINKED_SERVER)... )if previous transaction still open
User contributions licensed under CC BY-SA 3.0