Quantcast
Channel: Questions in topic: "sql-server-2005"
Viewing all articles
Browse latest Browse all 415

How to easily parse a column that is more than four delimited values.

$
0
0
I am using SQL Server 2005 and have a column containing data that looks like this: text1>text2>text3>text4>text5>text6. The delimiter is ">". Each portion (text1, text2, etc.) could contain: 1 or 2 blank spaces (text - text, text & text), ampersand, n-dash, apostrophe + s, comma, period. Six is the maximum delimited values. Or, should that be five? Six values and five delimiters? There is no set length or position for each delimiter. I have used REPLACE to swap the ">" for a "." I would like to set up temp tables or column aliases, whichever is easiest. We refer to this data as levels, so I would like text1 = level1, text2 = level2, etc. I have found all sorts of options to handle this but they all seem unnecessarily involved/complicated. This data is quite simple and clean. Isn't there a simple and clean option to parse or split this data? Thank you so much!!

Viewing all articles
Browse latest Browse all 415