Hola, saqué un ejemplo de internet q supuestamente anda, pero a mí no me
funciona, lo q quiero hacer es actualizar un conjunto de artículos pasándole
al SP una lista separada con comas de los id, @Codigos_Art nvarchar(200)
Servidor: mensaje 446, nivel 16, estado 9, procedimiento WebReservaMultiple,
línea 21
No se puede resolver el conflicto de intercalación para el operador equal
to.
Gracias x su antencion
Guido
Insetec Informática
[...]
/* Actualizar DETALLES_LISTA */
UPDATE DETALLE_LISTA_CASAMIENTO SET cliente_web = @ProxNro, Estado '41-RE'
WHERE Nro_Lista = @Nro_Lista
AND Codigo_Art IN (SELECT Value from Web_Split(@Codigos_Art,',') as
Split)
[...]
***La funcion es:
CREATE FUNCTION dbo.Web_Split
(
@List nvarchar(2000),
@SplitOn nvarchar(5)
)
RETURNS @RtnValue table
(
Id int identity(1,1),
Value char(7)
)
AS
BEGIN
While (Charindex(@SplitOn,@List)>0)
Begin
Insert Into @RtnValue (value)
Select
Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1)))
Set @List Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List))
End
Insert Into @RtnValue (Value)
Select Value = ltrim(rtrim(@List))
Return
END
Leer las respuestas