SA0064B : Check stored procedure names used in CREATE PROCEDURE statements for following specified naming convention

The topic describes the SA0064B analysis rule.

Message

Check stored procedure names used in CREATE PROCEDURE statements for following specified naming convention

Description

The rule checks stored procedure names used in CREATE PROCEDURE statements.

The NamePattern variable can be used to select or define the desired pattern which will be used to check the object name.

Regular expression patterns can be used, but the pattern must be prefixed with ‘regexp:’ string in order to be used as a matching regular expression.

Scope

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

Parameters
Name Description Default Value
NamePattern

Stored procedure name pattern.

regexp:usp[A-Z][A-Za-z]+

SchemaQualifiedNamePattern

Schema qualified name pattern.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Naming Rules, Code Smells

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
1CREATE PROCEDURE HumanResources.usp_GetAllEmployees
2AS
3    SELECT LastName, FirstName, JobTitle, Department
4    FROM HumanResources.vEmployeeDepartment;

Analysis Results

  Message Line Column
1 SA0064B : The procedure [HumanResources].[usp_GetAllEmployees] does not match the naming convention. The expected key name is [usp[A-Z][A-Za-z]+]. 1 32
See Also

Other Resources