I was wondering what the benefits were of having two separate functions for potentially returning all records if the primary key parameter is passed in as NULL, like:
UFTBadmUser##PK (@AsOfDate, @userid)
UFTBadmUser#PK (@AsOfDate, @userid)
Why not just have the one function that uses
where (UserID = @user-id or @user-id is null)?
It can't be that much of a performance hit to check whether or not a parameter's value is null and why would you even have a @user-id parameter in the second function at all if the only time you would use it would be if you wanted to pass @user-id = null?