gpt4 book ai didi

mysql - Insert with openquery to MySql table 错误 : "Cannot start more transactions"

转载 作者:行者123 更新时间:2023-11-29 00:13:35 25 4
gpt4 key购买 nike

我正在使用链接服务器将我的 SQL Server 2005 连接到 MySql 服务器。 selectupdatedelete 到 MySql 表都没有问题(我在 Microsoft SQL Server Management Studio Express 中编写查询)。但是,为什么我不能插入到我的 Mysql 表中?

我尝试了很多方法来插入:

insert into to_kporder...barang values (900, 'testt', 2);
insert into to_kporder...barang (id_barang, stock_code, id_company) values (900, 'testt', 2);
insert openquery (to_kporder, 'select id_barang, stock_code, id_company from barang') values (900, 'testt', 2);
insert into openquery (to_kporder, 'select id_barang, stock_code, id_company from barang') values (900, 'testt', 2);

to_kporder 是我的链接服务器。

barang 是我在 mysql 服务器上的表。

barang(id_barang, stock_code, id_company)

我的所有代码都返回消息:

OLE DB provider "MSDASQL" for linked server "to_kporder" returned message "Cannot start more transactions on this session."
Msg 7395, Level 16, State 2, Line 1
Unable to start a nested transaction for OLE DB provider "MSDASQL" for linked server "to_kporder". A nested transaction was required because the XACT_ABORT option was set to OFF.

最佳答案

我也有这个错误。尝试了各种方法,包括重新启动 SQL 服务和代理,但无济于事。

然而,在游标/结果详细信息部分“强制使用 forward_only 游标”中将 ODBC 上的设置更改为关闭。

解决了问题!

关于mysql - Insert with openquery to MySql table 错误 : "Cannot start more transactions",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23773470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com