How to name tables with MSSQL

  • 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.

Table naming conventions

  • A meaningful name in plurals ie: invoices and not invoice or customers and not customer
  • Unless the word already implies a plural such as inventory which implies many parts or components.
  • The singular refers to a single row of data while the plural refers to the table, all of the ....
  • Separate lexical element with underlines: _ It makes it easier to read such as: Sales_2008
  • Keep the table names short but meaningful. Do not create a table such as: InventoryStockByFiscalQuarter
  • The name should only be alpha-numeric characters: 0-9, A-Z, and a-z with words separated by _ for readability.

Table naming conventions options

  • Some people like to add at the beginning of the table name a short abbreviation of the database such as: Acct_NADs for the table NADs [names and addresses] in the database Accounting. I don't think that is necessary because when you refer to another database, you always have to qualify it with the database name such as: Accounting..Acct_NADs.
  • Some people like to add at the beginning of the table name a Tbl" such as: TblNADs for the table NADs'' [names and addresses]. We already know that it's a table because it's a plural and whenever I table about the table TblNADs, I mention the word table then the Tbl...
  • Do not use any reserved word in the name of the table.

Applies to:

  • Microsoft SQL Server 2000
  • Microsoft SQL Server 2005
  • Microsoft SQL Server 2008
  • All SQL Servers