Creating a stored procedure with a variable number of parameters

I want to create a SQL Server stored procedure with a different number of parameters. It is similar to "params" in C #.

How can i do this?

+3
source share
2 answers

Put them in XML and try the OPENXML function.

http://msdn.microsoft.com/en-us/library/ms186918.aspx

+4
source

You can’t .

What you can do is provide a default value for some parameters of the stored procedure, so you do not need to specify them when calling the stored procedure.

SQL Server 2008 , table-valued ( ) - . , .

+4

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


All Articles