O'Reilly logo

Writing Stored Procedures for Microsoft SQL Server by Matthew Shepker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Naming Conventions

As a developer, I am sure that you have found that for almost everything, someone somewhere has established naming conventions for how things are described. When dealing with SQL Server, no one has decided what the naming standards for objects in the database are. Naming conventions allow you to write code that is self documenting and, hence, easier to read.

Microsoft Discrepancies in Naming Convention

Looking at some of Microsoft's code, you will find that even Microsoft does not use a standard naming convention. Take a look at the code snippets in Listings 4.3 and 4.4 from the sp_help and sp_rename system stored procedures, respectively.

Code Listing 4.3. Old sp_help
 create proc sp_help @objname nvarchar(776) = NULL ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required