Skip to main content

As far as i can see, there is no option in the SF to define default values for subroutine parameters. When a default value could be defined they become an optional parameter in SQL server. 

I would like to suggest this add such an option in the SF?
The advantage is that you don’t have to define all parameters when calling a subroutine.

As far as I can see is that in the subroutine parameters an extra field should be added with default value. In the generate process the declaration of the parameters need to be changed so the variable will be declared as:
create procedure proc_1 
( @a id

 @b id = 0

as begin

 In this case @b becomes an optional parameter and when calling procedure proc_1 there is no need to pass a value for parameter @b

 

Updated idea status NewOpen

This should also apply to `functions` 


OpenOn the backlog

This will be helpful for us too.


We have a procedure that will be extended with more parameters overtime.
But the issue that will arise with new parameters is that we need to add the extra parameter on all places in code where the procedure is called


@kenterweeme, Procedures will be possible to extend this way once this idea is implemented. Functions do always require all parameters to be filled, either with a value or with keyword DEFAULT.


On the backlogWorking on it!