Something like this.
Could put it in a function.
declare @i int, @j-2 int, @end int
select @i = 1, @j-2 = 0, @end = 0
while @end = 0
begin
select @i = charindex(@i+1,',' + @STR + ',',',001,')
select @j-2 = @j-2 + 1
if @i = 0
select @end = 1
end
Cursors never.
DTS - only when needed and never to control.