Declare @listofIDS table(zipcodeids int) DECLARE @ZipCod...

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 int)

DECLARE @ZipCodeIDS varchar(10)
SET @ZipCodeIDS = '1'

IF @ZipCodeIDS IS NOT NULL
  BEGIN
    IF CHARINDEX(',', @ZipCodeIDS) = 0
    BEGIN
      insert @listofIDS values(@ZipCodeIDS)
    END
    ELSE
      BEGIN
        set @ZipCodeIDS+= ','     
        WHILE CHARINDEX(',', @ZipCodeIDS) != 0
        BEGIN
            insert @listofIDS values(Left(@ZipCodeIDS, CHARINDEX(',',@ZipCodeIDS) - 1))
            SET @ZipCodeIDS = SUBSTRING(@ZipCodeIDS, CHARINDEX(',',@ZipCodeIDS)+1, LEN(@ZipCodeIDS) - CHARINDEX(',',@ZipCodeIDS))
        END
      END
  END
select * from @listofIDS 

Enter Parameters

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