Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I parse a varchar field based on a delimiter ?

Status
Not open for further replies.

JFK40

Programmer
Apr 30, 2003
5
0
0
IE
I need some help on the following please.

I am trying to parse or 'break up' a varchar field based on a delimter in SQL. I have tried using substr and postr but this gets very messy as the number of parts increases. There must be am easier way to do this, but I can't think of it.

Any suggestions would be gratefully appreciated !
 
If this is a one time exercise; you may skip the SQL approach and simply export the table to a file. Then use the import wizard of either Excel and Access to split up the records using the seperation character, do a column count, create a table accordingly and upload the data again.
Looks very hard to accomplish with just SQL......

T. Blom
Information analyst
tbl@shimano-eu.com
 
Sorry but this is not a one off exercise. But it could be done via SQL or in a stored procedure.

Any further ideas ?
 
Could you possibly do something with the CASE statement and SUBSTR? This would of course depend upon the size of the field being parsed.
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top