如何解决本机客户端错误"连接正忙于另一个命令的结果"?
时间:2020-03-05 18:46:34 来源:igfitidea点击:
当SSIS程序包运行时,我从SQLServer Native Client驱动程序收到"连接忙于另一个命令的结果"错误。仅当与SQLServer 2000对话时。与SQLServer 2005对话的另一部分似乎总是可以正常运行。有什么想法吗?
解决方案
回答
Microsoft KB文章822668与此处相关:
FIX: "Connection is busy with results for another command" error message occurs when you run a linked server query Symptoms Under stress conditions, you may receive the following error message when you perform linked server activity: Server: Msg 7399, Level 16, State 1, Procedure <storedProcedureName>, Line 18 OLE DB provider 'SQLOLEDB' reported an error. OLE/DB Provider 'SQLOLEDB' ::GetSchemaLock returned 0x80004005: OLE DB provider SQLOLEDB supported the Schema Lock interface, but returned 0x80004005 for GetSchemaLock .]. OLE/DB provider returned message: Connection is busy with results for another command OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ::CreateSession returned 0x80004005. Note The OLE DB source of the error may vary. However, all variations of the error message include the text "Connection is busy with results for another command". Resolution To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000.
如此处所述,此问题首先在SQL Server 2000 Service Pack 4中得到了解决。
RDA Corp的高级软件工程师Mark Meyerovich的这篇博客文章也提供了一些见解(由于原始链接已失效,因此已存档):
SQL Server service pack upgrade A quick search on Google turns up the following article (http://support.microsoft.com/kb/822668): FIX: "Connection is busy with results for another command" error message occurs when you run a linked server query. It basically implies the issue is a bug and recommends an upgrade to Service Pack 4. We have started out with SQL Server 2000 SP3 and we do have some linked servers in the equation, so we give it a try. After the upgrade to SP4 – same result.
回答
正如我刚刚发现的那样,如果未启用MARS,这在SQL 2005上也可能发生。我什至不知道默认情况下它是禁用的,但是它确实是禁用的。并确保我们正在使用
" NATIVE OLEDB \ SQL Native Client"连接类型。如果我们使用的是" OLEDB.1"类型的连接(或者其他任何方法),那么MARS甚至都不是一种选择,并且我们将获得SQL 2000行为,这是令人讨厌的。
我们可以通过打开连接属性,然后单击"全部",然后在Management Studio中进行排序来启用MARS。
我知道问题早已得到解答,但我只是想把它扔给像我这样被其烫伤的下一个傻瓜。