Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hii to all,
when iam trying to insert or update a record in to a table present in remote server from my local computer by writing a trigger iam geeting a following error:-
"The operation could not be performed because OLE DB provider "MSDASQL" for linked server "MYSQL" was unable to begin a distributed transaction". and iam writing a trigger like following

CREATE TRIGGER MYSQLLogRecords
ON mainlog
FOR INSERT
AS
BEGIN
SET NOCOUNT ON
IF EXISTS(SELECT *FROM mainlog)
--BEGIN
INSERT OPENQUERY(MYSQL,'SELECT * FROM users.nsparelog')
SELECT * FROM inserted
ELSE
INSERT OPENQUERY(MYSQL,'SELECT * FROM users.nsparelog')
SELECT * FROM inserted
END.
Iam using a linked server for connecting to MYSQL database, Please can any one help me hoe should i overcome this error.Thanks in advance

thanks
Ramu
Posted
Updated 27-Feb-13 2:16am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900