July 2, 2008 at 3:32 am
Hi
I've noticed at our company stored procedures gets prefixed with "sp" and not "sp_". My question is does "spStoredProc" have the same penalties as "sp_StoredProc"
I know about "sp_" but what about "sp" ?
July 2, 2008 at 4:13 am
It is only procedures with 'SP_' prefix that cause the performance impact of scanning the system databases first.
'SP' should be fiine.
July 3, 2008 at 12:31 am
steveb (7/2/2008)
It is only procedures with 'SP_' prefix that cause the performance impact of scanning the system databases first.'SP' should be fiine.
So, isn't some similar scanning occur when all the stored procedures start with the same prefix? ('SP' in this case). Not maybe for the system databases, but within the procedures in that specific context?
Although I have not tested it properly, it seems that one should name his/her stored procedures as unique as possible for the maximum performance, starting from the first character.
Were any tests done on that?
July 3, 2008 at 2:48 am
adnan.korkmaz (7/3/2008)
steveb (7/2/2008)
It is only procedures with 'SP_' prefix that cause the performance impact of scanning the system databases first.'SP' should be fiine.
So, isn't some similar scanning occur when all the stored procedures start with the same prefix? ('SP' in this case). Not maybe for the system databases, but within the procedures in that specific context?
BOL only talks about not using 'sp_, another reason is that they may come up with the same name as your procedure on a future release.
Although I have not tested it properly, it seems that one should name his/her stored procedures as unique as possible for the maximum performance, starting from the first character.
I don't see how naming your stored procedures with the same prefix would affect performance at all. It has always been the norm in places I have worked to have a common procedure prefix as part of the naming standards.
Were any tests done on that?
I haven't done any tests my information comes from BOL.
July 3, 2008 at 1:58 pm
HI
Check out the below link
http://www.sqlservercentral.com/Forums/Topic8041-65-1.aspx
http://www.sqlmag.com/Article/ArticleID/23011/sql_server_23011.html
Thanks -- Vj
July 3, 2008 at 2:41 pm
Well i think everybody should start using the schema based Sepration Procedures for all objects. that will also be helpful in distinguishing the Objects and relate them to specific criterias.
Maninder
www.dbanation.com
July 7, 2008 at 8:01 am
I would recommend as a MINIMUM that all the stored procs you create be abbreviated usp_ for "user stored procedure." Not only does that avoid the sp_ issue but it keeps your stored procs seperate.
July 15, 2010 at 4:01 am
RonKyle (7/7/2008)
I would recommend as a MINIMUM that all the stored procs you create be abbreviated usp_ for "user stored procedure." Not only does that avoid the sp_ issue but it keeps your stored procs seperate.
That is an excellent idea. I have extended it to use asp_ for administrator only stored procedures that the user will never use.
July 15, 2010 at 4:19 am
Note: 2 year old thread.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 15, 2010 at 5:35 am
Maninder S. (7/3/2008)
Well i think everybody should start using the schema based Sepration Procedures for all objects. that will also be helpful in distinguishing the Objects and relate them to specific criterias.
I agree and I would like to use domains, but I find resistance to adopting such a new concept.
August 31, 2011 at 12:00 pm
Pardon me for jumping on a dormant thread, I came across this while researching naming conventions. Regarding the prefix "sp" (with or without the underscore), doesn't the sp stand for "System Procedure" and not "Stored Procedure"? Which would essentially be a vote against that prefix for user defined procedures used in applications.
Just curious.
Thanks,
--Jim
September 5, 2011 at 10:05 am
September 5, 2011 at 10:28 am
I know it's several years old but that's still a good article, Roy. They should rerun it now and again.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 5, 2011 at 10:31 am
Thanks Jeff. That was my second article for SSC. 🙂
-Roy
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply