General area for some code musings. Maybe some notes for things I frequently forget and want to reference quickly. Beats sticky-notes™
This is an argument/discussion I've had many times in the past.

So let's say* we have a table for addresses. Is it the Address tables or the Addresses table?

Lots of, (OK, two), opinions on this, but I think that whatever the decision, it should be applied uniformly within the database.

Now let's say we have a table for Users, (who doesn't have that table?), and we've decided to use singular. No problem, right?

Here's a sample SELECT in SQL with a User table:

Does anyone *really* want to use the [] notation everytime they reference the User table? (User, of course, being a keyword in SQL)

Do what you will, but for me, I'm sticking with plural table names.

Another discussion I've had at length in various places.

There are perhaps many possibilities, but having your stored procedures for, say, the Users table, in order when you view then in *whatever* product, (SQL Server Management Studio, Visual Studio, plain old Windows Explorer), you're using to maintain them is a definite plus for me.

All Users table stored procedures are together visually, for you, the coder. The same goes for all other tables.

What was finally decided upon was this:

First off, do NOT prefix your stored procedure names with "sp_". This may be old reasoning, but it definitely was a thing, at least at one point.

The eventual solution, which I feel I can defend all night long?

"p_" + TableName + "_" + Action

  • p_Users_Get()
  • p_Addresses_Update()
  • p_UserPreferences_Insert()
  • p_Users_ListGet()

Notice the last one: I also favor, (for the "Action" portion of the name), Object + Action.

Dunno, just makes more sense to me rather than p_Users_GetList().