Walk the string

0

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

declare @S varchar(20)
set @S = '116853,114044,102913,103182,104720,104721,105344,110134,103242,102810,11313,110154,104733,114064,103262,104491,1107749,107211,108464,108628,113483,113501'

while len(@S) > 0
begin
  print left(@S, charindex(',', @S+',')-1)
  set @S = stuff(@S, 1, charindex(',', @S+','), '')
end

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results