wsturdev
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;904 44 (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
12345;67890;2345678;12;904
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER