title: What is your naming convention for stored procedures?
body: <p>I have seen various rules for naming stored procedures. </p>
  
  <p>Some people prefix the sproc name with usp_, others with an abbreviation for the app name, and still others with an owner name. You shouldn't use sp_ in SQL Server unless you really mean it.</p>
  
  <p>Some start the proc name with a verb (Get, Add, Save, Remove). Others emphasize the entity name(s).</p>
  
  <p>On a database with hundreds of sprocs, it can be very hard to scroll around and find a suitable sproc when you think one already exists. Naming conventions can make locating a sproc easier.</p>
  
  <p>Do you use a naming convention? Please describe it, and explain why you prefer it over other choices.</p>
  
  <p><strong>Summary of replies:</strong>  </p>
  
  <ul>
  <li>Everybody seems to advocate consistency of naming, that it might be more important for everyone to use the same naming convention than which particular one is used.</li>
  <li>Prefixes: While a lot of folks use usp_ or something similar (but rarely sp_), many others use database or app name. One clever DBA uses gen, rpt and tsk to distinguish general CRUD sprocs from those used for reporting or tasks.</li>
  <li>Verb + Noun seems to be slightly more popular than Noun + Verb. Some people use the SQL keywords (Select, Insert, Update, Delete) for the verbs, while others use non-SQL verbs (or abbreviations for them) like Get and Add. Some distinguish between singluar and plural nouns to indicate whether one or many records are being retrieved.</li>
  <li>An additional phrase is suggested at the end, where appropriate. GetCustomerById, GetCustomerBySaleDate.</li>
  <li>Some people use underscores between the name segments, and some avoid underscores. app_ Get_Customer vs. appGetCustomer -- I guess it's a matter of readability.</li>
  <li>Large collections of sprocs can be segregated into Oracle packages or Management Studio (SQL Server) solutions and projects, or SQL Server schemas.</li>
  <li>Inscrutable abbreviations should be avoided.</li>
  </ul>
  
  <p><strong>Why I choose the answer I did:</strong> There are SO many good responses. Thank you all! As you can see, it would be very hard to choose just one. The one I chose resonated with me. I have followed the same path he describes -- trying to use Verb + Noun and then not being able to find all of the sprocs that apply to Customer. </p>
  
  <p>Being able to locate an existing sproc, or to determine if one even exists, is very important. Serious problems can arise if someone inadvertently creates a duplicate sproc with another name. </p>
  
  <p>Since I generally work on very large apps with hundreds of sprocs, I have a preference for the easiest-to-find naming method. For a smaller app, I might advocate Verb + Noun, as it follows the general coding convention for method names.</p>
  
  <p>He also advocates prefixing with app name instead of the not very useful usp_. As several people pointed out, sometimes the database contains sprocs for multiple apps. So, prefixing with app name helps to segregate the sprocs AND helps DBAs and others to determine which app the sproc is used for.</p>