Testing Distributed Transaction Coordinator on a Remote MSSQL Server using SQL Query Analyzer
December 31, 2004 Leave a comment
When using transactions in SQL or BizTalk, the Distributed Transaction Coordinator (DTC) must be configured to allow network clients (typically referred to “Network DTC Access”) This step is part of BizTalk installation on this blog (found in My Reference Posts), but I’ve broken it out here.
On the SQL Server that will allow remote transaction access:
- Navigate to Administrative Tools, Component Services.
- Click Component Services.
- Expand Computers.
- Select the local computer, right-click for Properties.
- Select the MSDTC tab and click the Security Configuration button.
- Check the “Network DTC Access” checkbox.
- Check the “Network Clients” checkbox.
- Click “OK” until the Component Services window is closed (DTC will stop and restart).
Once complete, perform this simple test to ensure you can execute transactions on a remote MSSQL client (requires SQL Client Tools):
- Open SQL Enterprise Manager and connect to the server to test. Local or SA crendentials are suitable for this test.
- In the left pane, select the desired server.
- Open SQL Query Analyzer.
- Paste the following code in the query pane, modifying the [‘servername’] attribute with the server name you’re testing (square brackets are required).
- Execute the query.
If DTC is properly configured, the query should execute and return a single field.
begin tran
create table #temp (columname varchar(20))
insert #temp select top 1 name from [xprtm-michaelco].master.dbo.sysobjects
select * from #temp
drop table #tempcommit tran
I’ve tested this in multiple environments where DTC operations have failed, but I have yet to see it fail in a previously-working environment under the following conditions:
- A previously-working DTC environment, removing “Network Clients” or “Network DTC access”.
- A previously-working DTC environment, stopping the DTC service on the SQL Box.
I’d appreciate any insight or observations from experts.