How to extract a delimited value from the table

  • Table Name: Busroute

    Route Places

    12G Florida, Vienna, Los Angels, ....

    How to extract the value (Places) whenever delimiter (,) comes.

    Eg., Florida

    Vienna

    Los Angels

  • You would need a split string function.

    Search this site for "DelimitedSplit8K" for a very fast T-SQL solution.

    Or have a look at Florian's blog for a comparison of different solutions including a CLR which is considered to be even faster than the solution I mentioned above.



    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]

  • Can any give me the easiest way to check?:

  • This is the same issue discussed in your other thread. Storing multiple delimited values in a single column is absolutely horrible design and you'll end up with nothing but headaches and inefficiencies.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • chandrasekaran.ganapathy (8/2/2010)


    Can any give me the easiest way to check?:

    Yes: see my previous post.



    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]

Viewing 5 posts - 1 through 4 (of 4 total)

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