Question

When I attempt to load data from a linked server connection that references a remote machine, I receive the following errors:

The operation could not be performed because OLE DB provider "DBDRIVER" for linked server "DATABASENAME" was unable to begin a distributed transaction.
OLE DB provider "DBDRIVER" for linked server "DATABASENAME" returned message "No transaction is active.".

I checked that the Distributed Transaction Coordinator services on both transaction partners were running and allowing network connections correctly.

Was it helpful?

Solution

This issue occurred because the server was not configured to allow ad hoc distributed queries. After enabling the setting on the server using this script below the query succeeded.

sp_configure 'ad hoc distributed queries', 1 
go 
reconfigure with override 
go 

The info came from this document, and it helped organize the troubleshooting. In short, it recommends the following:

  1. Make sure the DTC service is running
  2. Check that the DTC settings to ensure it can access the network
  3. Ensure the DTC traffic is allowed through any firewalls
  4. Use SET XACT_ABORT ON in queries
  5. Enabled the "Ad Hoc Distributed Queries" configuration option in SQL Server
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top