Database Naming for Consistency

I recently had an email chat with Dr Greg Low (Microsoft Regional Director & Readify) during the week about the best naming conventions (best practices) for SQL Server (especially in the post-hungarian notiation, SQL 2K5 schema days).
 
In fact, this is a topic being discussed (again) on the SQL Downunder mailing list – just this very moment.  Greg is preparing a book on the subject (which I’m likely to purchase for reference) although I have my ow speciic agenda around SQL conventions.
 
Here are some personal insights, agree with them or disagree, but I’m just going to put them *out there*..
 
1. Avoid underscores and spaces in names (especially spaces)
 
2. Don’t use hungarian notation (we can debate what the true meaning of hungarian notation is later, but the industry as a whole tended to use it to indicate the data type of a variable or column instead of the true meaning, which was to indicate the column/variable’s usage).
 
3. Avoid abbreviations – some can be handy (they shorten names without changing the meaning of a term) but overused they become messy and difficult to read.  Also if you do employ them make sure they are used the same way and consistenty throughout the database.
 
4. Consider wrapping objects into schemas, it allows easy management of object ownership and association with roles, etc.
 
That’s a short list.. I’ll come back to this topic later..

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.