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:

  1. 11179-1: Framework for the Specification and Standardization of Data Elements Definitions
  2. 11179-2: Classification for Data Elements
  3. 11179-3: Basic Attributes of Data Elements
  4. 11179-4: Rules and Guidelines for the Formulation of Data
  5. 11179-5: Naming and Identification Principles for Data
  6. 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:

  1. Should be unique (within any data dictionary in which it appears).
  2. Should be stated in the singular.
  3. Should state what the concept is, not only what it is not.
  4. Should be stated as a descriptive phrase or sentence(s).
  5. Should contain only commonly understood abbreviations.
  6. Should be expressed without embedding definitions of other data elements or underlying concepts.

Syntax Rules

These rules specify the arrangement of name components:

  1. The object class term occupies the leftmost position in the name, unless it is the subject of a qualifier term.
  2. The qualifier terms precede the component qualified. The order of qualifiers must not be used to differentiate data element names.
  3. The property term follows the object class term.
  4. The representation term occupies the rightmost position.
  5. 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:

  1. Nouns are used in singular form; verbs, if any, are in the present tense.
  2. No special characters are allowed.
  3. All words are separated by spaces.
  4. All words are in mixed case.
  5. Abbreviations, acronyms, and initialisms are allowed.

Representation Term List

RepresentationExplanation
AmountMonetary quantity
AverageNumeric value representing an arithmetic mean
CountNon-monetary numeric value arrived at by counting
CodeA system of valid symbols that substitute for longer values
DateCalendar date
MeasureA record of the dimensions, capacity/amount (non-monetary) of an object
NameA designation for an object
NumberA number associated with an object, used as an identifier
QuantityNon-monetary numeric value not arrived at by counting
RateA quantity or amount considered in relation to another quantity or amount
TextAn unformatted descriptive field
TimeTime 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