• The above will not produce exact expected results for some of the cases:

    Yes, but in general your solution won't too. Imagine a few more spaces at the end or begining.

    declare @a varchar(500)

    set @a = ' Alexandria , VA , Arlington , TX '

    set @a = replace(''''+replace(@a,',',''',''')+'''',''','' ',''',''')

    select @a

    If we are talking about timming spaces or doing smth else with the elements, it would be better to split string, do manipulations and concat it back.


    I am really sorry for my poor gramma. And I hope that value of my answers will outweigh the harm for your eyes.
    Blog: http://somewheresomehow.ru[/url]
    Twitter: @SomewereSomehow