Síntomas
Suponga que crea un procedimiento almacenado que usa un cursor en una variable de tabla en Microsoft SQL Server 2012 o SQL Server 2014. Además, el procedimiento almacenado actualiza la tabla con una instrucción WHERE CURRENT of junto con el cursor. Por ejemplo, el procedimiento almacenado puede ser similar al siguiente:
CREATE PROCEDURE dbo.usp_TestSP AS BEGIN DECLARE @TableVar TABLE (SomeInt INT NULL) INSERT @TableVar VALUES (NULL) DECLARE @curInt INT, @newInt INT SET @newInt = 1 DECLARE ccc CURSOR LOCAL FOR SELECT SomeInt FROM @TableVar WHERE SomeInt IS NULL OPEN ccc FETCH NEXT FROM ccc INTO @curInt UPDATE @TableVar SET SomeInt = @newInt WHERE CURRENT OF cccCLOSE ccc SELECT * FROM @TableVar END
Al ejecutar el procedimiento almacenado con el procedimiento almacenado del sistema sp_refreshsqlmodule , se puede producir una violación de acceso y puede recibir mensajes de error similares a los siguientes:
MSG 596, Level 21, State 1Cannot continue la ejecución porque la sesión se encuentra en el estado Kill. Mensaje 0, nivel 20, estado 0A se produjo un error grave en el comando actual. Los resultados, si los hay, se deben descartar.
En esta situación, los errores similares a los siguientes también se escriben en los registros de errores de SQL Server:
fecha y hora. 730 spid51 SqlDumpExceptionHandler: el proceso 51 generó una excepción grave c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.date time.730 spid51 * *******************************************************************************date time.730 spid51 *date time.730 spid51 * BEGIN STACK DUMP:date time.730 spid51 * date time spid 51date time.730 spid51 *date time.730 spid51 *date time.730 spid51 * Exception Address = 00007FFC270236D5 Module(sqllang+00000000005036D5)date time.730 spid51 * Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATIONdate time.730 spid51 * Access Violation occurred reading address 0000006F00620074date time.730 spid51 * Input Buffer 136 bytes -date time.730 spid51 * EXECUTE sp_refreshsqlmodule N'[dbo]. [usp_TestSP] ' fecha y hora. 730 spid51 * fecha hora. 730 spid51 *
Solución
Información sobre la actualización acumulativa
Este problema se ha corregido en las siguientes actualizaciones:
-
Actualización acumulativa 13 para SQL Server 2014
-
Actualización acumulativa 6 para SQL Server 2014 Service Pack 1 (SP1)
-
Actualización acumulativa 2 para SQL Server 2012 Service Pack 3 (SP3)
-
Actualización acumulativa 11 para SQL Server 2012 Service Pack 2 (SP2)
Cada actualización acumulativa para SQL Server contiene todas las revisiones y todas las revisiones de seguridad incluidas en la actualización acumulativa anterior. Consulte las últimas actualizaciones acumulativas para SQL Server:
Estado
Microsoft ha confirmado que se trata de un problema de los productos de Microsoft enumerados en la sección "Se aplica a".
Referencias
Obtenga más información sobre la terminología que Microsoft usa para describir las actualizaciones de software.