El Store que arme ... me da el siguente error ...
aparentemente solo funciona una vez
Servidor: mensaje 512, nivel 16, estado 1, línea 1
Subquery returned more than 1 value. This is not permitted
when the subquery follows =, !=, <, <= , >, >= or when the
subquery is used as an expression.
EL ENCABEZADO ES:219
EL ENCABEZADO (OUTPUT) ES:-6
alguien sabe porque??
USE delphos2
GO
DROP PROCEDURE EncE_Retorno --BORRO EL PROCEDIMIENTO
GO
CREATE PROCEDURE EncE_Retorno @id_enc char(20)
OUTPUT as
SET NOCOUNT ON --Hace que deje de
devolverse como parte de los resultados el mensaje que
indica el número de filas afectado por una instrucción
Transact-SQL.
-
SELECT @id_enc = Id_Encabezado_del_estudio
FROM FlagsDenominacion WHERE Id_Estudio = '99998'
RETURN(SELECT Id_Encabezado_del_estudio
FROM FlagsDenominacion WHERE Id_Estudio = '99998')
go
DECLARE @Encabezados char(20)
DECLARE @ReNCABEZADO CHAR(20)
exec @Encabezados = EncE_Retorno @id_enc
= @ReNCABEZADO OUTPUT
PRINT 'EL ENCABEZADO ES:' + CONVERT( CHAR
(12), @ReNCABEZADO) ''' IMPRIMO EL RETORNO
PRINT 'EL ENCABEZADO (OUTPUT) ES:' +
CONVERT(CHAR(12), @Encabezados)
GO
SET NOCOUNT OFF --OFF no se devuelve el
número
go
Leer las respuestas