Click or drag to resize

SA0248 : Stored procedure called with mixing both unnamed and named arguments style

The topic describes the SA0248 analysis rule.

Message

Stored procedure called with mixing both unnamed and named arguments style

Description

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.

Scope

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

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules, New Rules

Additional Information

There is no additional info for this rule.

Example Test Script
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

Analysis Results

 MessageLineColumn
1SA0248 : Stored procedure called with mixing both unnamed and named arguments style.35
See Also

Other Resources