Birden fazla gelen için ekstra fazla kod yazman gerek.
Şu örnek işine yarar.
declare @index int, @chars varchar(max), @string nvarchar(max) = 'a,b,c,d,e', @delimiter nvarchar(1) = ','
select @index = 1
if len(@string)<1 or @string is null return
while @index!= 0
begin
set @index = charindex(@delimiter,@string)
if @index!=0
set @chars = left(@string,@index - 1)
else
set @chars = @string
set @string = right(@string,len(@string) - @index)
if len(@string) = 0 break
print(@chars)
endBu sana direk şu şekilde sonuç verir.
a
b
c
d
e