The topic describes the DF158 T-SQL code analysis rule.
EXECUTION RULES
An unnamed parameter is used after a named parameter in the EXECUTE procedure statement.
If the parameter name is used for any parameter, it must be used for all subsequent parameters.
When mixing named and unnamed parameters, there is a risk of misalignment between the parameters passed to the procedure and the parameters expected by the procedure. This can result in incorrect data being passed to the procedure or in the procedure not functioning as intended.
This can also make the code less readable and harder to maintain. In case of errors or unexpected behavior, debugging becomes more challenging and identifying the source of the problem can be more time-consuming and error-prone.
EXEC @Result = dbo.DemoProcedure @x = 12
,10
GO
EXEC @Result = dbo.DemoProcedure @x = 12
,@y = 10
GO