我正在尝试对链接服务器运行 SQL,但出现以下错误:
BEGIN DISTRIBUTED TRANSACTION
SELECT TOP 1 * FROM Sessions
OLE DB provider "SQLNCLI" for linked server "ASILIVE" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Line 3
The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "ASILIVE" was unable to begin a distributed transaction.
提供程序返回两个错误:
错误 #1:
Number: $80040E14
Source: Microsoft OLE DB Provider for SQL Server
Description: OLE DB provider "SQLNCLI" for linked server "ASILIVE" returned message "No transaction is active.".
HelpFile:
HelpContext: $00000000
SQLState: 01000
NativeError: 7412
错误 #2
Number: $80040E14
Source: Microsoft OLE DB Provider for SQL Server
Description: The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "ASILIVE" was unable to begin a distributed transaction.
HelpFile:
HelpContext: $00000000
SQLState: 42000
NativeError: 7391
如何让 Microsoft 偏爱功能而不是安全?
或者,至少,我怎样才能让两个 SQL 服务器相互通信?
相关问题
- 无法执行操作,因为 OLE DB 提供程序“SQLNCLI10”...(*链接服务器名称为
(null)
) - 分布式事务错误?(使用 Oracle 提供程序)
- 无法使用 NHibernate 加入分布式事务(使用 Hibernate)
- 在 SQL Server 2008 R2 中使用分布式事务时出错(SQL Server 2008 R2,没有答案)
- 仅通过代码的分布式事务错误(由连接池引起)
- 在链接服务器中执行分布式事务协调器时出错(SQL Server 2008,没有答案)
- 分布式事务错误?(没有接受的答案;只有答案没有帮助)
- 如何使用链接服务器内部事务插入远程表?(接受的答案无法解决)
我所做的无关紧要,但无论如何我都会发布它。
诅咒和发誓。
砸东西。
检查是否
SELECT
可以使用链接服务器:SELECT * FROM ASILive.CustomerManagementSystem.dbo.Users .... (763 row(s) affected)
-
C:\Documents and Settings\avatar>ping asicmstest.contoso.com Pinging asicmstest.contoso.com [10.0.0.40] with 32 bytes of data: Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Ping statistics for 10.0.0.40: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
检查远程服务器是否可以按名称与启动服务器通信:
C:\Documents and Settings\avatar>ping asitestserver.contoso.com Pinging asitestserver.contoso.com [10.0.0.22] with 32 bytes of data: Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Ping statistics for 10.0.0.22: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
检查是否
@@SERVERNAME
与两台服务器上的服务器名称匹配:SELECT @@SERVERNAME, SERVERPROPERTY('MachineName') ------------- ------------- ASITESTSERVER ASITESTSERVER
和
SELECT @@SERVERNAME, SERVERPROPERTY('MachineName') ---------- ---------- ASIGROBTEST ASIGROBTEST
尖叫
-
SET XACT_ABORT ON GO BEGIN DISTRIBUTED TRANSACTION SELECT TOP 1 * FROM Sessions
-
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer
在两台服务器上。