Delimited String in one Column

  • Hello Everyone

    I am working with a delimited string in a single column. Yes, I know. I am ready to kill someone over this.

    But anyway, how can I write some code to parse that string. Below is an example:

    Ivory,White,Sage,Brown,Black,Lavender,Caribbean,Lt Pink,Dark Purple

    Some rows have more and some have less, there is not a set length.

    I am load on this one

    Thank you in advance

    Andrew SQLDBA

  • Did you search this site for "DelimitedString8K" on this site?

    This is a function posted by Jeff Moden. If you get the "right thread" (don't recall the link right now) you'll end up with several very fast versions, including a CLR (Paul White's preference, as it seems 😉 )



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Very nice, that is perfect.

    Really fast and works perfectly

    Andrew SQLDBA

  • Which one did you try? T-SQL or CLR?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • The CLR

    It is rather quick.

    Andrew

  • Hi Andrew,

    Can you share the link where you found the options.

    [font="Verdana"]Regards,
    Rals
    [/font].
  • rajesh.subramanian (10/21/2010)


    Hi Andrew,

    Can you share the link where you found the options.

    here is one : http://www.sqlservercentral.com/Forums/Topic943562-338-1.aspx#bm944589

    Am hunting down Paul White CLR.. will update soon...

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply