Naming conventions with Microsoft SQL Server
- Naming conventions are not necessary, but they make life much easier when they make sense and are followed.
- These are my conventions, they are not mandatory.
- Many people have their own conventions, great! keep them.
- I do not intend to impose my conventions on them, just here, are mine.
- I try to follow the naming conventions from ISO 11179-5 Annex A.
Naming conventions
The ISO Standard 11179 is made of 6 sections:
- 11179-1: Framework for the Specification and Standardization of Data Elements Definitions
- 11179-2: Classification for Data Elements
- 11179-3: Basic Attributes of Data Elements
- 11179-4: Rules and Guidelines for the Formulation of Data
- 11179-5: Naming and Identification Principles for Data
- 11179-6: Registration of Data Elements
Naming Data Elements, data definition
Section 11179-4 has a good simple set of rules for defining a data element. The data definition:
- Should be unique (within any data dictionary in which it appears).
- Should be stated in the singular.
- Should state what the concept is, not only what it is not.
- Should be stated as a descriptive phrase or sentence(s).
- Should contain only commonly understood abbreviations.
- Should be expressed without embedding definitions of other data elements or underlying concepts.
Syntax Rules
These rules specify the arrangement of name components:
- The object class term occupies the leftmost position in the name, unless it is the subject of a qualifier term.
- The qualifier terms precede the component qualified. The order of qualifiers must not be used to differentiate data element names.
- The property term follows the object class term.
- The representation term occupies the rightmost position.
- If a word in any term is deemed redundant with another word, one occurrence will be deleted.
Lexical Rules
These rules determine the standard "look" of names:
- Nouns are used in singular form; verbs, if any, are in the present tense.
- No special characters are allowed.
- All words are separated by spaces.
- All words are in mixed case.
- Abbreviations, acronyms, and initialisms are allowed.
Representation Term List
| Representation | Explanation |
|---|---|
| Amount | Monetary quantity |
| Average | Numeric value representing an arithmetic mean |
| Count | Non-monetary numeric value arrived at by counting |
| Code | A system of valid symbols that substitute for longer values |
| Date | Calendar date |
| Measure | A record of the dimensions, capacity/amount (non-monetary) of an object |
| Name | A designation for an object |
| Number | A number associated with an object, used as an identifier |
| Quantity | Non-monetary numeric value not arrived at by counting |
| Rate | A quantity or amount considered in relation to another quantity or amount |
| Text | An unformatted descriptive field |
| Time | Time of day or duration |
Also See:
SQL Programming Style by Joe Celko @ amazon.com (US)
Applies to:
- Microsoft SQL Server 2000
- Microsoft SQL Server 2005
- Microsoft SQL Server 2008
- All SQL Servers

