Following SQL Server objects naming conventions may be used primarily to standardize the DB objects naming structure. Conventions will be applied to Tables, Views, Stored Procedures, Functions and Triggers.
- Table name should be descriptive of its content e.g staff, staff_education.
- No space should be used; under score may be used where necessary.
- Adding tbl as a prefix should be avoided.
- Domain of functionally may be reflected in name as for Inventory Management System related tables, we may name as IMS_Wing, IMS_Vendor, IMS_Issue.
- View name should have VW as prefix. E.g vw_staff_posting, vw_sancstrength
- View name may also contain names of its base table/tables. E.g vw_staff_staffeducation
- Name of user stored procedure should be suffixed with USP.
- Stored Procedure name should reflect application to which it belongs. For example for any AD Hoc reporting application we may use USP_AdHoc_GetSummary
User Defined Functions
- Name of user defined function should have UDF as a prefix.
- UDF name should reflect the application to which it belongs. For example for any AD Hoc reporting application we may use UDP_AdHoc_calculateSummary
- Trigger name should always have T as prefix.
- Next to T it should have I, D or U to reflect insert, delete or update event on which it will be invoked. E.g TI_staffLog, TU_staffLog, TD_StaffLog.