Appendix A. Naming Conventions
by Orryn Sledge
Recommended naming conventions for SQL Server are listed in Table A.1.
Object | Naming Convention | Example |
---|---|---|
database | (business name) | sales |
table | (business name) | customer |
constraint | ||
| (table name) + _fk | customer_fk |
| (table name) + _pk | customer_pk |
| (table name) + _uniq | customer_uniq |
Or | ||
| fk_ + (table name) | fk_customer |
| pk_ + (table name) | pk_customer |
| uniq_ + (table name) | uniq_customer |
index | ||
| (column_name) + _cdx | customer_id_cdx |
| (column name) + _idx | customer_id_idx |
trigger | ||
| (table name) + _dtr | customer_dtr ... |
Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.