Declare @listofIDS table(zipcodeids varchar(10)) Declare...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

Declare @listofIDS table(zipcodeids varchar(10))

Declare @ZipCodeIDS varchar(100)
set @ZipCodeIDS= '14'

set @ZipCodeIDS+= ','
;with cte as
(
select substring(@ZipCodeIDS, 1, charindex(',', @ZipCodeIDS) - 1) num, charindex(',', @ZipCodeIDS) pos
union all
select substring(@ZipCodeIDS, pos + 1, charindex(',', @ZipCodeIDS, pos +1) - pos - 1) num, charindex(',', @ZipCodeIDS, pos +1)
from cte
where charindex(',', @ZipCodeIDS, pos +1) > 0

)
INSERT @listofIDS 


SELECT * FROM @listofIDS

Enter Parameters

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