• You could split the string using the Delimited Split Function refernced in my signature and the "FOR XML PATH" approach together with a DISTINCT to build te final string.

    If the length of each element is known and constant, the split function can be simplified.



    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]