Stored Procedures Naming

Stored Procedures Naming
kick it on DotNetKicks.com

   In this post we will see how to make good / ease to understand stored procedure.
Suppose you are having XYZ_Products table in your database where XYZ is the name of Data Base.
How to name the Insert Procedure written for New product insert ?

Create Procedure XYZ_Products_Insert
  @ProductName     varchar(15)
,  @CreateDate DataTime

As
  Begin
    Insert Into XYZ_Products(ProductName,CreateDate) 
                     values (@ProductName,getdate())
  end

 


How we had named it ? We have taken Name of the Table then suffixed this name with operation that we are performing, In this case its Insert operation.

e.g.
       XYZ_Products_UpdateByProductName
       XYZ_Products_GetByProductName
       XYZ_Products_GetAll
       Xyz_Products_GetByCategoryID 
 


The common practice is NameOfTheTable_OperationName


Satalaj

 

Tags:

Sessions In AspnettransactionSession application viewstateSET NOCOUNT ONASp.net 2.0 step by step Membership Provider C# XML XmlReaderAsp.net Convert String To ImageReportviewer and Temp VariablesPaypal purpose code IndiaMembershipProvider Get user UniqekeyHow to remove Security Tags

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.