• halifaxdal (10/27/2016)


    It turns out to be something with the original data import, the function str is fine, and no need because the re-import fixed the issue.

    Sorry for confusing.

    The STR() function might not be "fine". It's a whole lot slower than other methods and, depending on the scale, could produce rounded answers because it has a FLOAT backbone. Please see the following article.

    [font="Arial Black"]http://www.sqlservercentral.com/articles/T-SQL/71565/[/font]

    --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)