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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Multiple values from a field

Status
Not open for further replies.

cvkorke

IS-IT--Management
Feb 15, 2002
2
AE
Hi all

I have a SQL server field which has multiple values delimited by a newline(chr(13)) character. I would like to split the field into multiple fields. How is it possible to do it ? Is there an function which would help me do this ?

E.G I have SQL Server column named Brand

Field Name Values
Brand BrandX(delimiter)BrandY(delimiter(BrandZ)

(delimiter) is a newline character Chr(13)

I want to split the above values so that I get
Brand1 BrandX
Brand2 BrandY
Brand3 BrandZ

I know there will be a maximum of 10 brands.

Please Help

regards

Chetan
 
If you use SQL 2000, you can create a UDF to parse delimited strings. You can even download such a UDF.

Treat Yourself to Fn_Split()

There are several parse scripts you can download from SWYNK.COM. These are usable in SQL 7 and higher.

Terry L. Broadbent - Salt Lake City, UT
Home of the 2002 Winter Olympics (Feb 8-24)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top