To increase the flexibility of stored procedures and perform more complex processing, you can pass parameters to procedures. The parameters can be used anywhere that local variables can be used within the procedure code.
The following example is a stored procedure that requires three parameters:
CREATE PROC paramproc @parm1 int, @parm2 int, @parm3 intAS-- Processing goes hereRETURN
If you want to help identify the data values for which the parameters are defined, it is recommended that you give your parameters meaningful names. Parameter names, like local variables, can be up to 128 characters in length, including the @ sign, and they must follow SQL Server rules for identifiers. Up to 2,100 ...