SA0248 : Stored procedure called with mixing both unnamed and named arguments style |
![]() |
The topic describes the SA0248 analysis rule.

Stored procedure called with mixing both unnamed and named arguments style

The rule searches T-SQL code for stored procedure calls made using both named and unnamed arguments.
Mixing named and unnamed arguments when calling a stored procedure is not recommended.

To resolve the rule violation, rewrite the procedure call to use just one of the two methods.

The rule has a Batch scope and is applied only on the SQL script.

Rule has no parameters.

The rule does not need Analysis Context or SQL Connection.


Design Rules, Code Smells

There is no additional info for this rule.

SQL
1DECLARE @result INT 2EXEC @result = uspGetWhereUsedProductID 819, '20050225'; 3EXEC uspGetWhereUsedProductID;1 123, @CheckDate = '20050225', @StartProductID = 819; 4 5EXEC uspGetWhereUsedProductID @NoSuchParam = 123, @CheckDate = '20050225', @StartProductID = 819; 6 7EXECUTE AdventureWorks2008R2_Test.dbo.uspGetWhereUsedProductID @StartProductID = 819, @CheckDate = '20050225'; 8 9 10EXEC @result = uspGetWhereUsedProductID 819, '20050225', 122; 11DECLARE @output int 12EXEC @result = uspGetWhereUsedProductID 819, @output output,'20050225', 1223 ; 13EXEC @result = uspGetWhereUsedProductID 14EXEC TestReturnPlanForEX0018_Encrypted_Numbered;3 123 |

Message | Line | Column | |
---|---|---|---|
1 | SA0248 : Stored procedure called with mixing both unnamed and named arguments style. | 3 | 5 |
