• Jeff Moden (8/22/2014)


    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.

    Yeah, that's what I ended up doing 🙂

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP