MySQL Forums
Forum List  »  Microsoft SQL Server

Unable to begin a distributed transaction
Posted by: Tony Tugwell
Date: May 15, 2008 02:50PM

Synchronize data between two Windows 2003 servers.
MS/Server 2003 Database --> MySql Database in MS/Server 2003.

I have successfully created a linked server connection [TT-DEV] to a remote Windows server 2003 running MySql using MySql ODBC drivers 3.51 and 5.1 with SSL certificates applied via a datasource.

From the query window in Server management Studio, I can access remote data with OPENQUERY and also INSERT data.

I have also created a Stored Procedure that I can run that inserts a specific row from a local table into the remote table.

The problem arises when I apply a ON INSERT trigger on our local server that runs exactly the same script as my Stored Procedure, I get the error I've included at the bottom of this note. No error message included in the dialog box.

I've verified the MS DTC service is running etc.

Here is the script that runs successfully via the Query Window:
----------------------------------------------------------
INSERT INTO OPENQUERY([TT-DEV], 'SELECT client_number, name, address, address2, city, state, zip, country, phone, fax, email, contact_first_name, contact_last_name, active, TT_check FROM clients')
SELECT client_number, name, address, address2, city, state, zip, country, phone, fax, email, contact_first_name,
contact_last_name, active,
TT_check FROM CSIDATA.dbo.clients where client_number = 'TT99';
----------------------------------------------------------

Here's the Trigger script:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Name
-- Create date:
-- Description:
-- =============================================

ALTER TRIGGER [dbo].[INS_CLIENT]

ON [CSIDATA].[dbo].[clients]
FOR INSERT
AS
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SET XACT_ABORT ON

INSERT INTO OPENQUERY([LPI-DEV], 'SELECT client_number, name, address, address2, city, state, zip, country,
phone, fax, email, contact_first_name, contact_last_name, active, TT_check FROM clients')

SELECT client_number, name, address, address2, city, state, zip, country,
phone, fax, email, contact_first_name, contact_last_name, active, TT_check FROM dbo.clients where client_number = 'TT99'

----------------------------------------------------------
No row was updated.

The data in row 9 was not committed.
Error Source: .Net sqlClient Data Provider.
Error Message: The operation could not be performed because OLE DB provider "MSDASQL" for linked server "TT-DEV" was unable to begin a distributed transaction.

OLE DB provider "MSDASQL" for linked server returned message "[MySQL][ODBC 5.1 Driver]Optional feature not Supported".

Correct the errors and retry or press ESC to cancel the change(s).
---------------------------------------------------------

Any help or suggestions appreciated! Tony

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.