Click or drag to resize

SA0240 : The stored procedure does not return result code

The topic describes the SA0240 analysis rule.

Message

The stored procedure does not return result code

Description

The rule looks for stored procedures, which do not return result code.

When calling a stored procedure, the result code can be used to indicate the result of the execution.

It is a good practice to always return a result from stored procedures.

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
1alter procedure TestProc
2@param1 int
3as 
4begin
5    if(@param1 is null) return;
6    else return @param1*@param1;
7end;

Analysis Results

 MessageLineColumn
1SA0240 : The RETURN statement does not return a result code.524
See Also

Other Resources