Naming Convention for Stored Procedures

While creating stored procedures, it is imperative you name them intuitively corresponding to the process they do.

I have learnt that a good naming convention really makes it easy to find the stored procedure you are looking for and for other team of developers to debug, modify or extend your existing stored procedures.

Needless to say, good naming convention is also best practice in software development process.

Here is how I like or prefer to follow

[DbName]_[Object]_[Action/Process]

Here is an example,

DbApplicants_Products_Add
DbApplicants_Products_Update

Another common practice is to add sp (stored procedure) or something bespoke instead in the front, followed by object and then full action name for instance,

sp_Product_AddNewProduct
sp_Product_UpdateExistingProduct
CMS_Product_Create
CMS_Product_Update

I suppose the best way is to have a naming convention than to not have one.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s