Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  99 Posts | 0 Stories | 212 Comments | 236 Trackbacks

News

Archives

Post Categories

Blogroll

Yesterday, my colleague experienced a problem when trying to execute SQL statements through a linked server. The query was fine if execute alone like

exec linkserver.northwind.dbo.GetOrders '12/31/2004'

However, when he executed it and try to insert the result into temp table

insert into #orders
exec linkserver.northwind.dbo.GetOrders '12/31/2004'

The server just hung without doing anything furthur. He tried to kill SPID but it waited in KILL/ROLLBACK state forever.

Cause:

When executing SQL statements which involve data from 2 servers in an implicit transaction like the second statement (where data is retrieved from one place to insert into another place), SQL Server need to establish DTC transaction to make sure the transaction is atomic. However, if the remote server has the default installation of Windows 2003 Server, Network DTC is disabled by default. This means that SQL Server cannot establish the transactions and will try forever to achieve that.

Solution:

Follow the instruction from http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/e603c463-0636-4b85-8ada-c2b99f8555ac.mspx to enable Network DTC. If you have Windows Server 2003 SP1 installed, please also make sure that you open port for MSDTC to be connected remotely by either add MSDTC.exe to the allowed list or use the command line

netsh firewall set allowedprogram %windir%\system32\msdtc.exe MSDTC enable

posted on Wednesday, April 13, 2005 6:55 AM

Feedback

# re: SQL Server & MSDTC Problem in Windows 2003 6/2/2006 3:56 AM Darpan Jain
This is really useful as i was getting problems in using System.Transactions in .net

# re: SQL Server & MSDTC Problem in Windows 2003 4/11/2007 12:44 PM Diego
I've got a server for applications where I run the firebird, our server host the data base in sql...
We got it registred and we are experiencing this problem (Picked up from the event viewer):
MS DTC could not correctly process a DC Promotion/Demotion event. MS DTC will continue to function and will use the existing security settings. Error Specifics: %1

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

The server is auto restarting...when it return shows a driver fail and ask to check event viewer..
I do believe that this Warning on event viewer might be the cause of the restarts, in microsoft site, I couldn't get any usefull infos to help me sort it out...Please repply my doubts on diego@fundasinum.org.br
or try to log in skype to talk with me about this problem, our server does host this applications for more than 100 users in remote acess and stuff...so I'm really needing a help about this problem...
plus that I already formated it and reinstalled using the backup system.
Thanks. Diego Alves (TI)

# re: SQL Server & MSDTC Problem in Windows 2003 10/22/2007 3:16 AM shanmugam
The server is auto restarting...when it return shows a driver fail and ask to check event viewer..

I couldn't get any usefull infos to help me sort it out...Please repply my doubts on pshanmugam_sun@sify.com

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: