The Best Practice Theory
Walter Shields
Helping People Learn Data Analysis & Data Science | Best-Selling Author | LinkedIn Learning Instructor
SQL Server best Standards and Practices are a set of guidelines, rules and regulations on how to organize and optimize database environments to which they are applied. It refers to standardizing naming conventions of Tables, Views, Stored Procedures, Triggers, Indexes, Primary Keys, Normalization forms, Coding syntaxes and techniques.
With regard to SQL Server, these standards can be applied to two main areas; SQL Server Database Administration and SQL Server Application Coding, which support application development. This article focuses on the SQL Server coding standards that are applied to support application development.
SQL Server database administration, in comparison to application support, is much more static. The frequency and variation of changes that can occur in application supporting databases are usually quite high as applications are often modified to satisfy constant user requests. It is common to see application modifications performed by many developers other than the original author. This is one of the more prominent reasons a common coding practice is necessary to maintain a quality standard.
After fourteen years of seeing many application databases; SQL Server database coding standards seem to be more theoretical rather than a practiced standard. I can Google “SQL Best Practices and Standards” have some very good articles on the topic returned in my search result. Searching through a real world SQL database returns very different results when it comes it’s code standard.
What is often encountered are very different methods, styles and standards applied to the database by past developers. Some parts of the database may have a 'best practice’ applied to it, but more than likely this will be mixed with other non-standard practices in almost every aspect of the database (Coding, Naming Conventions, etc.).
The degree to which the theory of standard matches the practice of it, can be challenged in the SQL Server application database world.
Changing a developer’s style of coding by mandating that it conform to a standard is a daunting task, it just does not work. What always helps immensely is plain language communication via documentation. General script comments, line level comments, logs, manuals, wiki, etc. Any communication in plain language explaining the various objects of the database and how they function is invaluable. It speeds up the learning curve in understanding someone else’s work. When documented in this way, a more effective way of applying standardization to application databases becomes possible.