Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedure Naming Convention
Message
From
18/01/2015 20:32:16
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2014
Application:
Web
Miscellaneous
Thread ID:
01613725
Message ID:
01613841
Views:
52
In the link provided by Craig, they suggested using either the name of the Action first:

csp_GetPerson

or the name of the table first:

csp_PersonGet

I have always preferred putting the table name first, that way they all get grouped together, making them easier to find in SSMS. I also put an underscore after the table name (I think it's more readable):

csp_Person_Get

That suggestion isn't limited to table names, you could also use business processes (if the Stored Proc is going to be accessing several tables). For example:

csp_Orders_GetHistory
csp_Orders_GetCustomer

~~Bonnie


>I am sure this question has been asked a million times. And yet I am asking it again. I see everywhere online stored procedures named with prefix sp (e.g. sp_custom_account). Is there a technical or a logical reason for that? Since stored procedures are in SQL DB Programmability -> Stored Procedures, why need to tag them as SP still?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform