Home Forums SQL Server 2008 SQL Server 2008 - General Please HELP !! :SQL SERVER with MySQL Linked Server. Error Executing Trigger RE: Please HELP !! :SQL SERVER with MySQL Linked Server. Error Executing Trigger

  • mister.magoo (7/8/2013)


    your original error may be due to SQL server attempting to enlist a distributed transaction and MySQL cannot take part in that transaction.

    This would be because you are attempting to update MySQL from a trigger and the code is therefore running as part of the transaction that fires the trigger.

    You are right. I did not look too close on the error message, as there was an obvious syntax error in the MySQL query (the variable @id). But I more or less expect that the query I suggested would die with that error. Since you are in a trigger, you are in a transaction, and by default SQL Server attempts to make that a distributed transaction. (This can be changed with sp_serveroption). A distributed query may have better odds to work, if one uses the OLE DB provider for MySQL rather than MSDASQL + ODBC, but I would not count on it.

    (Just like Mister Magoo, I have no experience of MySQL myself.)

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]