2007-12-27

MSDTC on server is unavailable.

Trying to do with: running Using scope As Transactions.TransactionScope = New Transactions.TransactionScope() in vs 2005 pro by vb.net
Searched by: MSDTC on server is unavailable
Source from: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54705




[*]

On the server where the trigger resides, you need to turn the MSDTC service on. You can this by clicking START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES. Find the service called 'Distributed Transaction Coordinator' and RIGHT CLICK (on it and select) > Start.

Test the trigger and see if it works. If it still does not work, wrap you trigger in the following transaction code (found below in bold):


SET XACT_ABORT ON
BEGIN DISTRIBUTED TRANSACTION


-- Put all queries in here (SELECT, INSERT, UPDATE, and DELETE)
select * from [SERVER2].[DBASE].[OWNER].[TABLENAME]
update [SERVER2].[DBASE].[OWNER].[TABLENAME]
set [column] = value
where [condition(s)]

COMMIT TRANSACTION
SET XACT_ABORT OFF



This solution solved our problems, I hope they solve yours.
We ran into the following errors, and the above fixed them:
1. MSDTC on server is unavailable. [fixed this error by started the service above [*] ]
2. Server: Msg 7395, Level 16, State 2, Procedure name, Line 26
Unable to start a nested transaction for OLE DB provider 'SQLOLEDB'. A nested transaction was required because the XACT_ABORT option was set to OFF.
[OLE/DB provider returned message: Cannot start more transactions on this session.]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionLocal::StartTransaction returned 0x8004d013: ISOLEVEL=4096].

No comments:

Google Referrals