Click or drag to resize

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

The topic describes the SA0061B analysis rule.

Message

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

Description

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.

Scope

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

Parameters
NameDescriptionDefault 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_]+

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 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);

Analysis Results

 MessageLineColumn
1SA0061B : The table [T1.T2] does not match the naming convention. The expected key name is [[A-Z][A-Za-z1-9_]+].1013
2SA0061B : The table [tblMyTable] does not match the naming convention. The expected key name is [[A-Z][A-Za-z1-9_]+].1413
See Also

Other Resources