Subsitute of TO_CHAR in transact SQL???

  • Heh... I'm thinking "tie" and I'm thinking that, once again, only RegEx replace beats T-SQL... you sure it can't be done using some magic RegEx replace?

    And, by the way, I really appreciate the testing you've done with CLR's. I've got nothing to write them with.

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

  • Hi Jeff,

    Thanks, Your code works great.

    And I'll remember what you said about not storing formatted numbers.

    I just needed to retrieve data from database and format it in the select statement so that i can show formatted currency in my data grid which is directly bound to the data source.

    I just need to retrieve from database and not store anything back.

    Rgds,

    Kavita

  • Understood, Kavita... but doesn't the data grid have monetary formatting capabilities? That's where this type of formatting should really be done. If not (I guess it depends on who's grid you're using), can't you write a similar function in the app you're building to do the same type of formatting?

    And, thanks for the feedback 🙂

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

  • Jeff Moden (4/14/2008)


    Heh... I'm thinking "tie" and I'm thinking that, once again, only RegEx replace beats T-SQL... you sure it can't be done using some magic RegEx replace?

    And, by the way, I really appreciate the testing you've done with CLR's. I've got nothing to write them with.

    That's about what I was thinking. Could do it either way at this point....I'll think on the RegEx side - but I'm thinking the cure is worse than the disease....

    As to the coding - it keeps my head in the SQLCLR game (even though I have pretty much everything I'm going to use in SQLCLR on 2005), just so I'm not starting from scratch when 2008 finally comes out.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 4 posts - 16 through 18 (of 18 total)

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