Contents 

Ubitsoft SQL Enlight Online Help

Naming

SA0014 : Avoid 'fn_' prefix when naming functions.
SA0015 : Avoid 'sp_' prefix when naming stored procedures.
SA0042 : Avoid using special characters in object names.
SA0043 : Avoid using reserved words for type names.



Rule: SA0014

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.

Category

Naming

Additional Information

None


Rule: SA0015

Message

Avoid 'sp_' prefix when naming stored procedures.

Description

This rule checks for creation of stored procedure with names starting with "sp_".The prefix sp_ is reserved for system stored procedure that ship with SQL Server.

Whenever SQL Server encounters a procedure name starting with sp_, it first tries to locate the procedure in the master database, then it looks for any qualifiers (database, owner) provided, then it tries dbo as the owner. So you can really save time in locating the stored procedure by avoiding the "sp_" prefix.

Category

Naming

Additional Information

None


Rule: SA0042

Message

Avoid using special characters in object names.

Description

The rule checks the current context and the T-SQL code for user defined types using a reserved word as type name.

Naming a database object by using any special character:

- White spaces characters - space, tab, newline.

- Single and double quotation marks.

- Square brackets.

Using these characters will make it more difficult not only to reference that object, but also to read code that contains the name of that object.

Category

Naming

Additional Information

None


Rule: SA0043

Message

Avoid using special characters in object names.

Description

The rule checks the T-SQL code for creation of user defined types using a reserved word as a type name.

You should avoid using a reserved word as the name of a user-defined type because readers will have a harder time understanding your database code.

You can use reserved words in SQL Server as identifiers and object names only if you use delimited identifiers.

Category

Naming

Additional Information

None