Re: User defined functions

  • jlp3630 (10/3/2008)


    Are there any disadvantages to using t-sql user defined functions? From a coding/maintainability perspective, I prefer to use them. However, I wasn't sure if I was taking a performance hit by using UDFs versus "cutting and pasting" code.

    Like anything else... it depends. It depends on what the function does and how it does it. I've seen it where some functions actually increase the performance of a given query especially on multi-cpu or multi-core machines. At the same time, I've also seen certain functions drag the performance of a query right into the toilet. Like I said, it depends. 😉

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

Viewing post 16 (of 15 total)

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