Copying Data from MS SQL to MySQL (using triggers?)

Associate
Joined
16 Aug 2003
Posts
221
I am really struggling here, I have read numerous pages on this subject but nothing that ever really solves it.

I have an MS SQL 2005 Express database that I want to sync the data from a few tables into a MySQL database with the identical tables and coloumns (created using mssql2mysql).

I have downloaded and installed the MySQL ODBC driver and successfully setup a linked server instance in the MS SQL Express database.

As I understand it, I need to setup 'trigger's' in MS SQL Express that will update, insert or delete data accordingly in the MySQL database using OPENQUERY. As discussed here http://developer.infi.nl/index.php?ID=6&article=6

Now for some reason I cannot get it to work.

MS SQL 2005, from what I understand is to trys to use MSDTC to transfer the data but the MySQL ODBC Driver does not support it hence the error below.

Code:
OLE DB provider "MSDASQL" for linked server "MySQL_DB" returned message "[MySQL][ODBC 5.1 Driver]Optional feature not supported". Msg 7391, Level 16, State 2, Procedure MySQL_PointValue_trg, Line 17 The operation could not be performed because OLE DB provider "MSDASQL" for linked server "MySQL_DB" was unable to begin a distributed transaction.

The data will only change in the MS SQL database and therefore I will not need to sync any changes from the MySQL back to the MS SQL.

Can someone please point me in the right direction.
 
Using triggers would be the only way you'd be able to have it "realtime" and not have to run a large batch process. We're doing something sort of similar (SQL Server 2005 in a remote office, changes to products syncing to a remote e-commerce site) and have used CLR (.NET) triggers calling web-services to do that.
 
Back
Top Bottom