Click here to Skip to main content
15,887,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dears, i create a link server to another computer to create a synonym called "yso" in order to select from one table and insert into another table in another server also when i try to execute the following :

SQL
INSERT  INTO yso ( data )
SELECT  data
FROM    dbo.my


execution occurs successfully but when i execute it with transaction (Distributed Transaction):

SQL
BEGIN TRANSACTION
INSERT  INTO yso
        ( data )
        SELECT  data
        FROM    dbo.my
COMMIT TRANSACTION



i get the following error:
MSDTC on server 'MyPC' is unavailable.


i tried many ways "I check the services Distributed transaction Coordinator and Distributed Link Tracking Client in component services and they are working normally also i restart them, i restart the database server, i changed the settings under component Services/computers/Distributed Transaction Coordinator right click on Local DTC go to security tab and check all security settings and check if the account name is NT AUTHORITY\NetworkService"

all these are not working with my case so how can i resolve this issue..
Posted
Updated 5-May-20 22:17pm

1 solution

Go to component Services, under Console Root expand Component Services and then browse to Computers -> My Computer -> Distributed Transaction Coordinator. Right-click Local Distributed Transaction Coordinator and then click Properties:

Go to security tab. First check the box to enable Network DTC Access and then check all four available Allow options:
• Allow Remote Clients
• Allow Remote Administration
• Allow Inbound
• Allow Outbound
Also you'll need to select No Authentication Required and uncheck enable XA Transaction

Then when you try to execute your transaction you may face the following error:

OLE DB provider "SQLNCLI10" for linked server "RND-YMAZEH" returned message "Cannot start more transactions on this session.".
Msg 7395, Level 16, State 2, Line 23
Unable to start a nested transaction for OLE DB provider "SQLNCLI10" for linked server "RND-YMAZEH".
 A nested transaction was required because the XACT_ABORT option was set to OFF.


So you just need to uncomment the first line (you have to “add SET XACT_ABORT ON”) before start executing your transaction.
 
Share this answer
 
v2
Comments
Lonyem 17-Apr-19 23:38pm    
Youssef, great post on this prevalent DTC issue.
The write up of your solution is very simple and as straight forward as it gets.
Thanks much, it saved me a ton of headache.

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