• I agree that there're a lot of things, like this conversion, that should be done in the GUI instead of SQL Server. Displaying commas in dollar amounts and formatting dates and the like qualify, as well. That does two very good things... it distributes the "extra" clock cycles to the GUI thereby taking some of the load off of the server and it allows the GUI to format according to regional settings...

    ... if you have a GUI.

    If all you have is batch code, then finding a good high speed answer in T-SQL is worth it. And, no, CLR's aren't the Nirvana of code that everyone is looking for, either. Source code external to the Server must be maintained and they ususally can't beat a properly written solution in T-SQL. Matt Miller, me, and a couple of other folks did some pretty heavy testing against CLR's and the only one that came out better was a RegEx CLR that did replacements (I can't put my hands on the URLs... I'd have to do a search). Of course, just because someone says something like this doesn't mean you shouldn't also do some tests of your own for you own particular situation.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)