11

We have started naming our stored procedures as [16_TestStoredProc]. Are there any implications naming a stored procedure like this?

I am not going to explain why we are doing this. It is not that I have issues with this, but would to any implications.

7
  • 11
    Thanks for testing for all of us all the tools that break with unquoted names :) Aug 8, 2016 at 11:56
  • 2
    Thanks community for not bringing down this question saying Not a real question . I am sure this will help future readers to understand the implications of using different naming conventions. Aug 8, 2016 at 14:37
  • 5
    It would be interesting to know why you're doing this.
    – Hannah Vernon
    Aug 8, 2016 at 18:17
  • 2
    I recommend naming your stored procedures using a "NounVerb" pattern. Examples are "EmployeeGetAll" and "EmployeeInsert". This keeps all of your related stored procedures sorted together. Aug 8, 2016 at 20:08
  • 1
    That doesn't seem that it would make for a very usable solution, for your programmers or for long-term maintenance. I generally go with a VerbNoun pattern - GetEmployee, e.g. - which doesn't keep all of the Employee procedures together as NounVerb does, but it is much more intuitive. Aug 9, 2016 at 2:19

1 Answer 1

25

There are no technical issues with this.

It isn't going to make any difference to SQL Server.

From a usability point of view identifier names that begin with a number must always be quoted so

exec some_schema.16_TestStoredProc

would not be valid and you must always use

exec some_schema.[16_TestStoredProc]

Also when viewing the stored procedures alphabetically sorted - e.g. in Object explorer this prefix may well not be helpful in trying to find a stored procedure and as they are ordered lexicographically it may be somewhat inconvenient that 18_TestStoredProc precedes 2_TestStoredProc.

I am not going to explain why we are doing this

Well perhaps you have good reasons. As you aren't going to share them it isn't possible for us to comment on them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.