Home Forums SQL Server 2014 Development - SQL Server 2014 Select statements included within a function cannot return data to a client: SQL server 2014 RE: Select statements included within a function cannot return data to a client: SQL server 2014

  • dimpythewimpy (9/19/2016)


    Can someone suggest a workaround for this. I have researched online and tried inline function but,that didn't work as I am not returning a table here. It is just a single variable.

    Read the following article. It's not just about how to make scalar functions run faster. It's also about how to use an iTVF to return a Scalar Value. You'll have to change the way you use it compared to a true Scalar Function but paradigm shift is easy and makes for very fast code.

    http://www.sqlservercentral.com/articles/T-SQL/91724/

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