actually that example is pretty hideous
i'd probably go for something like
Code:
create function ConvertStringToList
(
@string varchar(1000),
@delimiter char
)
returns @rtn table (VAL int)
as
begin
declare @index int
set @index = CHARINDEX(@delimiter, @string)
IF @index >0
BEGIN
set @rtn = ConvertStringToList(SUBSTRING(@string, @index + 1, LEN(@string) - @index),@delimiter,@partiallist)
insert into @rtn values(SUBSTRING(@string, 1, @index - 1)
END
ELSE
insert into @rtn values(@string)
return
end
how ever that was written on the fly and hasn't been tested