March 14, 2002 at 2:53 pm
I am trying to create a UDF that will parse a string based up on delimeter (e.g. '_'). I want to call the UDF and have it return all the sub-strings.
Can a UDF return multiple strings?
What the best way to parse the following statement:
DATA1_DATA2_DATA3 ?
Assume:
1. Each part can vary in length
2. Could have up to 5 parts
3. Underbar is used only as a delimeter
March 14, 2002 at 4:42 pm
A UDF can return a table datatype. This would be your best bet.
It can do what you ask.
Steve Jones
December 8, 2002 at 8:46 pm
Several scripts have been posted recently that do exactly this.
December 9, 2002 at 7:26 am
The best way is to return a table, have a look at
http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=528
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply