Un error de almacenamiento Almacenado en sql server
Publicado por Maria (6 intervenciones) el 28/11/2017 21:01:57
Hola, alguien me puede ayudar con este error que me esta dando
Esta es la consulta:
Ejecutado
Este es el errror , esta hecho en sql server
Msg 512, Level 16, State 1, Procedure Cliente_NombreCompleto, Line 7 [Batch Start Line 21]
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Msg 245, Level 16, State 1, Procedure Cliente_NombreCompleto, Line 11 [Batch Start Line 21]
Conversion failed when converting the varchar value '"Maria Lopez"' to data type int.
Esta es la consulta:
1
2
3
4
5
6
7
8
9
10
11
12
13
ALTER PROCEDURE [dbo].[Cliente_NombreCompleto] (@Id_Cliente int, @NombreApellido varchar(150))
AS
BEGIN
Declare @Nombre varchar(50), @PApellido varchar(50), @SApellido varchar(50), @NombreCompleto varchar(150);
Set @Nombre=(Select Cliente.Nombre from Cliente where Cliente.Id_Cliente=Id_Cliente)
SET @PApellido=(Select Cliente.Primer_Apellido from Cliente where Cliente.Primer_Apellido=@PApellido);
SET @SApellido=(Select Cliente.Segundo_Apellido from Cliente where Cliente.Segundo_Apellido=@SApellido);
Set @NombreCompleto=(@Nombre+ @PApellido+@SApellido);
Return cast (@NombreApellido as varchar);
END
Ejecutado
1
execute dbo.Cliente_NombreCompleto 20, '"Maria Lopez"'
Este es el errror , esta hecho en sql server
Msg 512, Level 16, State 1, Procedure Cliente_NombreCompleto, Line 7 [Batch Start Line 21]
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Msg 245, Level 16, State 1, Procedure Cliente_NombreCompleto, Line 11 [Batch Start Line 21]
Conversion failed when converting the varchar value '"Maria Lopez"' to data type int.
Valora esta pregunta
0