Walk the string

0

Please login or register to vote for this query.

(click on this box to dismiss)

Philosophy Meta

Q&A about the site for those interested in the study of the fundamental nature of knowledge, reality, and existence

declare @S varchar(max)
set @S = '14029,13678,23531,29886,28571,13211,14029,15882,16864,17881,20563,21673,23531,24400,25836,27220,29218,29219,29920,31508'
declare @l int

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

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results