2 Development Standards

 

This chapter covers

  • An introduction to development standards
  • Naming standards
  • Coding standards

In this chapter we will explore why having (and following!) development standards is so important. So, let’s start by defining exactly what we mean when we talk about development standards in the context of building data-tier applications with SQL Server. Development standards cover the following areas:

  • Naming conventions
  • Coding standards
    • Stylistic
    • Technical

Specifically, we will look at the common mistakes that database professionals make and discuss how you can avoid the same pitfalls. As an example, imagine the topology depicted in figure 2.1.

Figure 2.1 A SQL Server topology with poor naming conventions

So, you get a call from the application team who look after an application called TimeChewer. They report that some of their queries are running slowly and ask you to take a look. They advise that the application’s database is hosted on the server called sql-shared-app-server.

You connect to the server and your heart immediately sinks. The instances are called SQL01 and SQL02. This gives you no indication of which instance may host the application’s database. So, you connect to each instance in turn, hoping to find a database with a name like “TimeChewer”. Unfortunately, you are greeted with database names DB01, DB02, DB03, and DB04.

2.1 #1 Non-descriptive object names

2.2 #2 Using object prefixes

2.3 #3 The dreaded sp_ prefix

2.4 #4 Not making time for coding standards

2.5 #5 Using ordinal column position

2.6 Summary

sitemap