Stored procedure with input and output parameters in sql
- create procedure with parameters in sql server
- create stored procedure with parameters in sql server management studio
- create procedure with output parameter in sql server
- create procedure with out parameter in sql server
Create stored procedure with parameters.
Specify parameters in a stored procedure
Applies to:SQL ServerAzure SQL DatabaseAzure SQL Managed InstanceAzure Synapse AnalyticsAnalytics Platform System (PDW)SQL database in Microsoft Fabric
By specifying procedure parameters, calling programs are able to pass values into the body of the procedure.
Sql server stored procedure with parameters
Those values can be used for a variety of purposes during procedure execution. Procedure parameters can also return values to the calling program if the parameter is marked as an OUTPUT parameter.
A procedure can have a maximum of 2100 parameters; each assigned a name, data type, and direction.
Optionally, parameters can be assigned default values.
The following section provides information about passing values into parameters and about how each of the parameter attributes is used during a procedure call.
Pass values into parameters
The parameter values supplied with a procedure call must be constants or a variable; a function name cannot be used as a parameter value.
Variables can be user-defined or system variables such as .
The following examples demonstrate passing param
- create procedure with input parameter in sql server
- create procedure with variables sql server