SA0061B : Check table names used in CREATE TABLE statements for table name following specified naming convention |
![]() |
The topic describes the SA0061B analysis rule.

Check table names used in CREATE TABLE statements for table name following specified naming convention

The rule checks the naming of table in CREATE TABLE 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.

Review the table name and rename it according to the naming convention.

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

Name | Description | Default Value |
---|---|---|
NamePattern |
Table name pattern. |
regexp:[A-Z][A-Za-z1-9_]+ |
SchemaQualifiedNamePattern |
Schema qualified name pattern. |
– |
TemporaryTableNamePattern |
Temporary table name pattern. |
regexp:[A-Z][A-Za-z1-9_]+ |

The rule does not need Analysis Context or SQL Connection.


Naming Rules, Code Smells

There is no additional info for this rule.

SQL
1CREATE TABLE dbo.EmployeePhoto 2 ( 3 EmployeeId int NOT NULL PRIMARY KEY 4 ,Photo varbinary(max) FILESTREAM NULL 5 ,MyRowGuidColumn uniqueidentifier NOT NULL ROWGUIDCOL 6 UNIQUE DEFAULT NEWID() 7 ); 8 9 10CREATE TABLE [T1.T2] 11(c1 int, c2 nvarchar(200) ) 12WITH (DATA_COMPRESSION = ROW); 13 14CREATE TABLE tblMyTable 15(c1 int, c2 nvarchar(200) ) 16WITH (DATA_COMPRESSION = ROW); |

Message | Line | Column | |
---|---|---|---|
1 | SA0061B : The table [T1.T2] does not match the naming convention. The expected key name is [[A-Z][A-Za-z1-9_]+]. | 10 | 13 |
2 | SA0061B : The table [tblMyTable] does not match the naming convention. The expected key name is [[A-Z][A-Za-z1-9_]+]. | 14 | 13 |
