I was working on some code to parse some data for a friend, and had
to write this little piece of code that some of you might find
useful. Right now, you can just take this, pop it into query
analyzer and run it. Its simple enough to change this to a
function that accepts the string, plus a delimeter value, such as:
CREATE FUNCTION dbo.ParseString (@string varchar(500), @delimeter char(1))
RETURNS table
Or do the same type thing using a stored procedure, whatever floats
your boat. You'll juse have to make some small modifications to
the code.
Here is the code:
The above code outputs:
ABC
DEF
GHIJK
LMNOPQRS
T
UV
WXY
Z