0
J'ai un problème pour analyser un paramètre de procédure stockée sous la forme:plusieurs filtres Parse dans SQL
declare @S varchar(100)
set @S = '4=2,24=1534'
est ici la requête:
select
cast(idx as varchar(100)) 'idx'
, value
, SUBSTRING(value, 1, charindex(value, '=')+1) 'first'
, SUBSTRING(value, charindex(value, '=')+1, LEN(value)-charindex(value, '=')-1) 'second'
from Common.SplitToTable(@S, ',') -- returns (idx int, value varchar(max))
where len(value) > 0
Mais voici le résultat que je reçois:
idx value first second
0 4=2 4 4=
1 24=1534 2 24=153
Voici ce que je pensais:
idx value first second
0 4=2 4 2
1 24=1534 2 1534
Aide?