![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm coming from a MS Access background and so I'm very used to and comfortable with the hungarian (Leszynski et al) naming conventions. However, I'm getting started into my first SQL Server Database and really want to use the appropriate up to date standard naming convention (ISO compliant). |
|
So what would the appropriate and most up-to-date and standard naming be for SQL Server? My Guess: Orders ===== Ord_Order_ID_Pk Ord_Customer_ID_Fk Ord_Order_Date ... Customers ======== Cus_Customer_ID_Pk Cus_Customer_Name ... |
#3
| |||
| |||
|
|
So what would the appropriate and most up-to-date and standard naming be for SQL Server? My Guess: Orders ===== Ord_Order_ID_Pk Ord_Customer_ID_Fk Ord_Order_Date |
|
I'm coming from a MS Access background and so I'm very used to and comfortable with the hungarian (Leszynski et al) naming conventions. However, I'm getting started into my first SQL Server Database and really want to use the appropriate up to date standard naming convention (ISO compliant). I think I have the general idea from raking though countless conflicting sites and posts, but I'm a bit stuck on what to do regarding pk / fk naming For example, in my MS Access world I would have two tables: tblOrders ======= strOrderID intCustomerID dtOrderDate ... tblCustomers ========== intCustomerID strCustomerName ... So what would the appropriate and most up-to-date and standard naming be for SQL Server? My Guess: Orders ===== Ord_Order_ID_Pk Ord_Customer_ID_Fk Ord_Order_Date ... Customers ======== Cus_Customer_ID_Pk Cus_Customer_Name ... How close (or far) am I from "Celko Proof" naming here? All help gratefully accepted! |
#4
| |||
| |||
|
#5
| ||||||
| ||||||
|
|
I'm getting started into my first SQL Server Database and really want to use the appropriate up to date standard naming convention (ISO compliant). |
|
I think I have the general idea from raking though countless conflicting sites and posts, |
|
.. but I'm a bit stuck on what to do regarding pk / fk naming |
|
For example, in my MS Access world I would have two tables: |
|
Ord_Order_ID_Pk Ord_Customer_ID_Fk |
|
How close (or far) am I from "Celko Proof" naming here? |


#6
| |||
| |||
|
|
typically when there are two FKs to instruments, and there > is a need to disambiguate them. |
#7
| |||
| |||
|
|
I was taught in school that entity names (tables) should always be in the singular. |
|
Object prefixes like tbl are okay. |
#8
| |||
| |||
|
|
The underscore separator is highly desirable when all lower/upper case names are used, which is often favored by organizations with case-sensitive collation standards. |
#9
| |||
| |||
|
|
I was taught in school that entity names (tables) should always be in the singular. That was an old DoD standard that started with file names based on the idea that you read one record at a time, so your unit of work world be one Order. The conventional wisdom now is that since a table is a set, you use a collective name when possible or a plural name if you have to (Personnel, not Employees; Forest, not Trees, etc.) Object prefixes like tbl are okay. No they are not. At best they are a redundancy that screws up the Data Dictionary. They violate the rule about naming things for their nature instead of their implementation or usage. And since SQL is a strongly typed language, they look really silly. Do you put "noun_" in front of all your nouns to make your sentences easier to read? |
|
As the ISO-11179 rules get into more meta data repository requirements, this is going to be important. |
#10
| |||
| |||
|
|
Get a copy of SQL PROGRAMMING STYLE might just do that! |
![]() |
| Thread Tools | |
| Display Modes | |
| |