Is it possible to create a function in TransactSQL that accepts a variable number of parameters (optional parameters)?

Yes, I know that I can do this using stored procedures. I am wondering if this is possible with functions.

+6
source share
1 answer

Not like a stored procedure - the parameter should still be placed at each position of the argument, but you can specify that it uses the default value from the declaration:

SELECT yourschema.yourudf(x, y, z, DEFAULT, a, b, c, DEFAULT) 
+12
source

Source: https://habr.com/ru/post/886201/


All Articles