Which Table-Values function is better?

  • I need one Function which output is only 1 row and 5 column.

    This function is call 3000 times in 1 hour.

    Which is better choice of following.

    Either it is Inline-Table-values Function

    OR it is Multi-Statement Table-values Function

  • Heh... it depends... what does the function do? And, why does it have to be a function?

    --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)
    Intro to Tally Tables and Functions

  • Very hard to say without knowing what you're trying to do. However, as was said before (http://qa.sqlservercentral.com/Forums/Topic586167-145-1.aspx), the multi-statement functions tend to perform rather badly, so do be careful with them

    Please, please don't post multiple threads for a single problem. It just wastes people's time answering questions that have already been answered.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • if possible can you post the sample code as to understand what exactly you are trying to do?

Viewing 4 posts - 1 through 3 (of 3 total)

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