SA0189 : Store procedure executed without getting a result

The topic describes the SA0189 analysis rule.

Message

Store procedure executed without getting a result

Description

The rule checks EXECUTE statements for stored procedure not being called and returned value assigned to a variable.

How to fix

Assign the result of the executed stored procedure to a local variable and handle any error result.

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.

Effort To Fix
13 minutes per issue.
Categories

Design Rules, Bugs

Additional Information

There is no additional info for this rule.

Example Test SQL
SQL
1USE AdventureWorks2012;
2
3DECLARE  @result INT
4EXEC @result = dbo.uspGetWhereUsedProductID  819, '20050225';
5
6EXECUTE  dbo.uspGetWhereUsedProductID  819, '20050225';

Analysis Results
  Message Line Column
1 SA0189 : Store procedure executed without getting a result. 6 0
See Also

Other Resources