General - Do you know object name should follow your company naming conventions?
Last updated by Brady Stroud [SSW] 7 months ago.See historyFollow naming conventions:
- SQL Server Object Naming Standard
- SQL Server Stored Procedure Naming Standard
- SQL Server Indexes Naming Standard
- SQL Server Relationship Naming Standard
- Use decreasing generality for table names ie.
Client
andClientInvoice
, thenClientInvoiceDetail
. - Don't use underscores, instead use upper and lower case ie.
ClientInvoice
is preferred overClient_Invoice
. - Table names should use plural ie.
Clients
is preferred overClient
. -
Generally, do not use abbreviations. But there are a few words that are so commonly used that they can be abbreviated. These are:
- Quantity =
Qty
- Amount =
Amt
- Password =
Pwd
- Quantity =
- Prefix all date fields with 'Date' ie.
DateInvoiced
. One extra use of this is you can have generic code that enables a date control on this field. - Suffix Percent fields with 'Pct' ie.
SalesTaxPct
. - Only use alphabet characters. ie. don't use
AustraliaListA$
. Avoid the following characters in your object names in SQL Server. If you do not do this, you will need to constantly identify those ill-named objects with bracketed or quoted identifiers - otherwise, unintended bugs can arise. - Don't use reserved words on their own. ie.
User
,Count
,Group
, etc. They can be used if joined with other words. See Reserved Keywords (Transact-SQL)