DF158: An unnamed parameter is used after a named parameter in the EXECUTE procedure statement.
Last modified: May 28, 2025
The topic describes the DF158 T-SQL code analysis rule.
Category
EXECUTION RULES
Message
An unnamed parameter is used after a named parameter in the EXECUTE procedure statement.
Description
If the parameter name is used for any parameter, it must be used for all subsequent parameters.
Additional information
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.
Noncompliant code example
EXEC @Result = dbo.DemoProcedure @x = 12
,10
GO
Compliant solution
EXEC @Result = dbo.DemoProcedure @x = 12
,@y = 10
GO
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.