Click or drag to resize

SA0014 : Avoid 'fn_' prefix when naming functions

The topic describes the SA0014 analysis rule.

Message

Avoid 'fn_' prefix when naming functions

Description

This rule checks for user defined scalar functions with 'fn_'.

Though this practice is supported, it is recommended that the prefixes not be used to avoid name clashes with Microsoft shipped objects.

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

Naming Rules

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
 1CREATE FUNCTION dbo.fn_myfunction
 2(   
 3     @value AS int
 4)
 5RETURNS int
 6WITH EXECUTE AS  CALLER
 7AS 
 8 BEGIN
 9    SET @value=@value + 1
10END;

Analysis Results

 MessageLineColumn
1SA0014 : Avoid 'fn_' prefix when naming functions.120
See Also

Other Resources