Ok, here's the part of BOL about CREATE FUNCTION:
CREATE FUNCTION [ owner_name. ] function_name
( [ { @parameter_name [AS] scalar_parameter_data_type [ = default ] } [ ,...n ] ] )(Bold is my emphasis)
Now, in
Invoking User-Defined Functions, we can find this:
When you invoke a function, you must supply argument values for all of the parameters...Now the question: what's the point of specifying a default if you've got to supply the argument in the first place? I wanted to have an optional argument to a function I'm creating, so based on the CREATE FUNCTION help, I assumed it was possible, but looks like it isn't.
Sylvain Demers