SA0159 : Deprecated use of object name containing only # characters

The topic describes the SA0159 analysis rule.

Message

Deprecated use of object name containing only # characters

Description

The rule checks for creating table, view, function or trigger, which are named only with a string of # character.

It is recommended to use at least one additional character to name an object.

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, Naming Rules, Deprecated Features, Code Smells

Additional Information
Example Test Script
SQL
 1CREATE TABLE #
 2(
 3GreetingId INT IDENTITY (1,1) PRIMARY KEY,
 4Message nvarchar(255) NOT NULL,
 5)
 6CREATE TABLE ##
 7(
 8GreetingId INT IDENTITY (1,1) PRIMARY KEY,
 9Message nvarchar(255) NOT NULL,
10)
11CREATE TABLE #table1
12(
13GreetingId INT IDENTITY (1,1) PRIMARY KEY,
14Message nvarchar(255) NOT NULL,
15)
16
17SELECT * INTO ##### FROM Test.Greeting g 
18WHERE 
19g.Message like 'Hello%'

Analysis Results

  Message Line Column
1 SA0159 : Deprecated use of object name containing only # characters. 1 13
2 SA0159 : Deprecated use of object name containing only # characters. 6 13
3 SA0159 : Deprecated use of object name containing only # characters. 17 14
See Also

Other Resources