Click or drag to resize

SA0191 : Procedure body is not enclosed in BEGIN...END block

The topic describes the SA0191 analysis rule.

Message

Procedure body is not enclosed in BEGIN...END block

Description

The rule checks for CREAT/ALTER PROCEDURE statements and reports if the procedure body is not enclosed in a BEGIN..END block.

It is recommenced to enclose the procedure body explicitly.

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
1CREATE PROCEDURE HumanResources.uspGetAllEmployees
2AS 
3SET  NOCOUNT ON;
4
5SELECT  LastName, FirstName, JobTitle, Department
6FROM  HumanResources.vEmployeeDepartment;

Analysis Results

 MessageLineColumn
1SA0191 : Procedure body is not enclosed in BEGIN...END block.10
See Also

Other Resources