Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL 2000 functions and parameters default value
Message
 
 
To
07/03/2002 13:32:06
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00629760
Message ID:
00629794
Views:
13
This message has been marked as the solution to the initial question of the thread.
You have to pass keyword "default" to indicate that function shoul use default value for that parameter.

>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.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform