Anton Shepelev (anton.txt@g{oogle}mail.com) writes:
MSSQL allows default values in parameters to functions:
CREATE FUNCTION test( @v INT = 1 )
RETURNS TABLE AS
RETURN ( SELECT @v AS v )
but will not let me use them -- the invocation
SELECT * FROM test()
fails with:
An insufficient number of arguments were supplied for the
procedure or function test.
I'm about to say that I don't even want to talk about this, because
it is so stupid. That is, you must supply the DEFAULT keyword explicitly:
SELECT * FROM dbo.test(DEFAULT)
Which of course defies quite much of the idea with a default parameter
when you want to add a new parameter to an existing function.
Here is a feedback item you can vote for:
https://feedback.azure.com/d365community/idea/95dbf609-5a25-ec11-b6e6- 000d3a4f0da0
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)