Link to home
Start Free TrialLog in
Avatar of wsturdev
wsturdevFlag for United States of America

asked on

Parse an Array

I have a parameter coming into a SPROC.  The parameter is a varchar, but is made of an unpredictable Longs separated by a semi-colon, such as:

12345;67890;2345678;12;90444 (the actual number of values is unpredictable)

I need SQL Logic for my sproc that will parse that varchar and let me access each of those longs, something like:

Declare @tmpArray
SET @tmpArray = @incomingvarchar
For i = lowerbound(tmpArray) to upperbound(tmpArray) step 1
      @longval = tmpArray(i)
      Do stuff with @longval
next i
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wsturdev

ASKER

Excellent!!  Thanks