Do you use a SQL Server object naming standard?

Updated by Jayden Alchin [SSW] 3 years ago. See history

123

This standard outlines the standard on naming objects within SQL Server. Use these standards when naming any object or fix if you find an older object that doesn't follow these standards.

ObjectPrefixExample
TableClients
Column (PK)Id
Column (FK)ClientId
Temporary Table_zt_ztClients
System Table_zs_zsDataVersion, _zsVersionLatest
Viewvw, gy_vwClientsWithNoPhoneW, gy_ClientsWithNoPhoneW
Stored Procedureproc, gp_procSelectClientsClientID, gp_SelectClientsClientID
TriggertrgtrgOrderIU
Default*dft *dftToday *
RulerulrulCheckZIP
User-Defined DatatypeudtudtPhone
User-Defined FunctionsudfudfDueDates

Note: 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