• Koen Verbeeck (8/22/2014)


    Found it 😀

    Apparently default values for parameters need to be constants, not other functions.

    http://stackoverflow.com/questions/470664/sql-function-as-default-parameter-value

    Boohoo SQL Server.

    I'm sure it's obvious to you but, in case anyone else reads this, you could assign the default values to be NULL and then reassign the variables to SYSDATETIME() if they're NULL.

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