Special Stored Procedure Naming Conventions

You must be aware of a couple of important things when working with SQL Server stored procedures. When you look at the system stored procedures included with SQL Server, you will see that they all begin with the prefix sp_. When I started programming with SQL Server, I assumed that all stored procedures should begin with sp_. I created hundreds of procedures using that prefix, until I ran across a small note in a SQL Server manual that said sp_ is the prefix for system stored procedures. Even then, that did not mean much to me. Finally, I read up on the sp_ prefix to find out what made that prefix so special.

If the first three letters of the stored procedure are sp_, SQL Server first searches the master ...

Get Writing Stored Procedures for Microsoft SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.