SA0185 : Review the call for unintentionally passing the same value more than once as an argument |
![]() |
The topic describes the SA0185 analysis rule.

Review the call for unintentionally passing the same value more than once as an argument

The rule checks SQL code for function or procedure calls for having the same values passed more than once as argument.

nReview your code and suppress the rule violation if the code is correct and the duplicated arguments are intentional.

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
1Test.Greeting 'message', 'message' 2 3declare @Message nvarchar(100) = 'hi' 4declare @Name nvarchar(10) = 'George' 5 6exec Test.Greeting @param1 = @Message, @param2 = @Message 7exec Test.Greeting @Message, @Message 8exec Test.Greeting @Name, @Message, @Name 9 10select isnull(message,message) from dbo.Greetings 11select isnull(message,'hello') from dbo.Greetings 12select isnull(@Name, @Message, @Name ) from dbo.Greetings 13select dbo.myFunction(name,name,message ) from dbo.Greetings 14 15 16select dbo.myFunction(1,2,10,1 ) from dbo.Greetings |

Message | Line | Column | |
---|---|---|---|
1 | SA0185 : Value appears more than once in the procedure arguments. | 1 | 14 |
2 | SA0185 : Value appears more than once in the procedure arguments. | 7 | 20 |
3 | SA0185 : Value appears more than once in the procedure arguments. | 8 | 20 |
4 | SA0185 : Value appears more than once in the function arguments. | 10 | 14 |
5 | SA0185 : Value appears more than once in the function arguments. | 12 | 14 |
6 | SA0185 : Value appears more than once in the function arguments. | 13 | 22 |
7 | SA0185 : Value appears more than once in the function arguments. | 16 | 22 |
