SQL TIP: Prefixing Stored Procedure With "sp_" Gives Your SP a Bad Name

Found this interesting article via Hassan Voyeau that details the performance penalty when naming your stored procedure with an sp_ prefix in a database other than the master database.

Personally, I hate adding extraneous and unecessary prefixes and suffixes to names. Sometimes they’re useful and necessary, like when programming in Fortran 77. But I hate naming tables with a tbl prefix and stored procs with an sp prefix (I’m forced to at my current position). Sql Enterprise Manager does a nice job of separating tables from stored procedures when they are being displayed. I’m never going to get the fact confused that that square looking thing on my database diagram is a table and not a user defined function.

Anyways, Hassan, how’s the weather in Trinidad?

Technorati Tags: ,

What others have said

Requesting Gravatar... Hassan Voyeau Jan 25, 2005 11:56 AM
# re: SQL TIP: Prefixing Stored Procedure With "sp_" Gives Your SP a Bad Name
The weather is perfect. We have 2 seasons, a dry season and a wet season (It rains more in the wet season). We are currently entering the dry season. The high temp is consistently 29 - 32 C all year round.
Requesting Gravatar... Rob Jan 20, 2008 4:25 PM
# re: SQL TIP: Prefixing Stored Procedure With "sp_" Gives Your SP a Bad Name
I agree. I am working on a project right now and doing a little web surfing to decide on a naming convention. I think prefixing a table or sp with 'tbl' or 'sp' is silly. I understand what that's all about but it seems to me that kind of a rule is implimented by inexperienced or unknowledgable developers (probably someone half in the business world). I wouldn't say its bad, but unnecessary and bothersome. I don't embroider 'towel' on all of my towels...
Requesting Gravatar... Hannah Oct 06, 2008 5:35 AM
# re: SQL TIP: Prefixing Stored Procedure With "sp_" Gives Your SP a Bad Name
Most people name stored procedures with the prefix usp_ (user stored procedure) to differentiate from sp_ which is a system procedure (as system procs are stored in master in assumed that anything with sp_ is master and looks for it there). But I don't think its necessary personally.

What do you have to say?

(will show your gravatar)
Please add 2 and 2 and type the answer here: