Home
General - Do you use a SQL Server Object Naming Standard?
  v3.0 Posted at 24/03/2020 9:33 AM by Christian Morford-Waite
​​This standard outlines the standard on naming objects within SQL Server. Use these standards when naming any object or if you find an older object that doesn't follow these standards within SSW.

​​All feedback is welcome. Thanks to all who gave feedback. A special thanks to Andy Baron.​


​Object
Prefix
Example
​Table
--​
​​Clients
​Column (PK)
​--
​Id
​Column (FK)
​--
​ClientId
​Temporary Table
​_zt
​_ztClients
​System Table
​_zs
​_zsDataVersion
_zsVersionLatest
​View
​vw, gy_
vwClientsWithNoPhoneW
gy_ClientsWithNoPhoneW​
​Stored Procedure
​proc, gp_
​procSelectClientsClientID
gp_SelectClientsClientID
​Trigger
​trg
​trgOrderIU
​Default*
​dft *
​dftToday *
​Rule
​rul
​rulCheckZIP
​User-Defined Datatype
​udt
​udtPhone
​User-Defined Functions
​udf
​udfDueDates

* We never use defaults as objects, this is really an old thing that is just there for backwards compatibility. Much better to use a default constraint.

​​​​

Other Links

SQL Server Coding Standards - Part 1​
By Steve Jones on SQL Server Central

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments: