Question:

  SQL SERVER 通过Linkserver连接A和B 2台,A对B执行单条的增删改查没有异常(没有配置DTC)

The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "SDSSDFCC" was unable to begin a distributed transaction.

 

但是开启事务后就会出现报错

The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "SDSSDFCC" was unable to begin a distributed transaction.

 

 


Solution:

在A和B上配置DTC(控制面板→管理工具→组件服务),配置参数如下:

The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "SDSSDFCC" was unable to begin a distributed transaction.

 

 

 再次测试无异常

 The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "SDSSDFCC" was unable to begin a distributed transaction.

开启事务前Set XACT_ABORT ON 否则会报以下异常

The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "SDSSDFCC" was unable to begin a distributed transaction.

 

相关文章:

  • 2021-08-18
  • 2021-06-20
  • 2021-12-11
  • 2021-09-30
  • 2022-12-23
  • 2021-12-25
  • 2021-07-29
  • 2021-07-16
猜你喜欢
  • 2022-03-04
  • 2021-10-13
  • 2021-06-15
  • 2022-01-08
  • 2021-12-09
  • 2021-05-15
  • 2022-12-23
相关资源
相似解决方案