SA0066A : Check all Columns for following specified naming convention |
![]() |
The topic describes the SA0066A analysis rule.

Check all Columns for following specified naming convention

The rule checks the naming of all columns in the current database.
The following parameters can be used to select or define the desired pattern which will be used to check the object name:
– GeneralColumnNamePattern – applied for all columns that do not fall in the other categories
– PrimaryKeyColumnNamePattern – applied for primary key columns
– ForeignKeyColumnNamePattern – applied for foreign key columns
– BitColumnNamePattern – applied for columns which are of data type Bit
– StringColumnNamePattern – applied for string columns
– DateTimeColumnNamePattern – applied for date time columns
– NumericColumnNamePattern – applied for numeric data type columns
– BinaryColumnNamePattern – applied for binary data type columns
– GeographyColumnNamePattern – applied for geography data type columns
– HierarchyidColumnNamePattern – applied for HierarchyId data type columns
– UniqueidentifierColumnNamePattern – applied for uniqueidentifier data type columns
– XmlColumnNamePattern – applied for Xml data type columns
– SqlVariantColumnNamePattern – applied for sql_variant data type columns
– TableColumnNamePattern – applied for table data type columns
– TimestampColumnNamePattern – applied for Timestamp data type columns
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 column name and rename it according to the naming convention.

The rule has a ContextOnly scope and is applied only on current server and database schema.

Name | Description | Default Value |
---|---|---|
GeneralColumnNamePattern |
General column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
PrimaryKeyColumnNamePattern |
Primary key column name pattern. |
{table_name}ID |
ForeignKeyColumnNamePattern |
Foreign key column name pattern. |
{referenced_column} |
BitColumnNamePattern |
Bit column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
StringColumnNamePattern |
String column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
DateTimeColumnNamePattern |
Datetime column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
NumericColumnNamePattern |
Numeric column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
BinaryColumnNamePattern |
Binary column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
GeographyColumnNamePattern |
Geography column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
HierarchyidColumnNamePattern |
Hierarchyid column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
UniqueidentifierColumnNamePattern |
Uniqueidentifier column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
XmlColumnNamePattern |
Xml column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
SqlVariantColumnNamePattern |
Sql_Variant column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
TableColumnNamePattern |
Table column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |
TimestampColumnNamePattern |
Timestamp column name pattern. |
regexp:[A-Z][A-Za-z1-9]+ |

The rule requires Analysis Context. If context is missing, the rule will be skipped during analysis.


Naming Rules, Code Smells

There is no additional info for this rule.
