Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tsql 执行SP_Open游标会导致SMS出现严重错误_Tsql_Sql Server 2008_Ssms - Fatal编程技术网

Tsql 执行SP_Open游标会导致SMS出现严重错误

Tsql 执行SP_Open游标会导致SMS出现严重错误,tsql,sql-server-2008,ssms,Tsql,Sql Server 2008,Ssms,我们的程序通过SP_Opencursor执行一个存储过程,我通过跟踪成功地提取了准确的调用,当直接在SMSS中运行代码时,我们得到了一个严重的错误 declare @p1 int set @p1=0 declare @p3 int set @p3=16388 declare @p4 int set @p4=8196 declare @p5 int set @p5=0 exec sp_cursoropen @p1 output,N' EXEC [dbo].[EventSearchSP] ''hip

我们的程序通过SP_Opencursor执行一个存储过程,我通过跟踪成功地提取了准确的调用,当直接在SMSS中运行代码时,我们得到了一个严重的错误

declare @p1 int
set @p1=0
declare @p3 int
set @p3=16388
declare @p4 int
set @p4=8196
declare @p5 int
set @p5=0
exec sp_cursoropen @p1 output,N' EXEC [dbo].[EventSearchSP] ''hip''  ',@p3 output,@p4 output,@p5 output
select @p1, @p3, @p4, @p5
运行上述代码时,我们会出现以下错误:

Executing SQL directly; no cursor.
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.
这段代码过去是有效的,直到最近才失败。它跨实例上的所有数据库失败(超过100个)

在其他服务器上运行代码时,该过程将正确执行,并且不会失败

存储过程的实际数据相当通用,只有一列数字。我不相信这是存储过程本身的问题,因为从客户机程序执行任何存储过程时都会出现此问题


我很快就想不出办法来解决这个问题了,有人知道是什么原因导致这个错误突然开始了吗?它以前工作正常吗?

我们发现了这个问题,如果有人知道它为什么是个问题,我很想知道,这样我就可以找到解决它的方法

经过研究,我们最近在SQL server上的connections中设置了XACT_ABORT ON特性,这被普遍认为是最佳实践。然而,当此设置打开时,我们得到了上述错误,在再次关闭该功能后,程序开始像以前一样工作


不幸的是,我们打开XACT_ABORT是为了解决另一个问题,现在我们需要找到另一个解决方案

sql server错误日志是否包含任何其他信息?