It is really up to you. I prefer CamelCase.
I hate using underscores or hyphen. But I have not see it cause an issue in SQL Server, except in the case of databases with underscore or hyphen, don't do that, you will be sorry in the long run.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Just wondering what different standards may be out there for naming SQL Server Stored Procedures.
I don't mind CamelCase...But I'd personally prefer separating by underscore "_" or hyphens "-". To me it just makes it easier to read and decipher what the SQL Server Stored Procedure is used for.
I have read where you should use dashes or hyphens "-" as opposed to underscores "_" because certain elements do not handle underscores well.
So if someone can maybe give their two cents as to standards they've been exposed to and what they like and what they dislike about them, I'd GREATLY appreciate it.
Thanks in advance.
It is really up to you. I prefer CamelCase.
I hate using underscores or hyphen. But I have not see it cause an issue in SQL Server, except in the case of databases with underscore or hyphen, don't do that, you will be sorry in the long run.
If you use hyphens, procedure names needs to be quoted:
CREATE PROCEDURE [my-very-own-procedure]
since the hyphen is also the minus operator. You don't have to do this with underscores.
As Tom says, it is up do you. I'm more used to using underscores, but currently I'm in a CamelShop. The only advice I can give is to be consistent.
Hi @Bobby P ,
If you prefer using underscores ,you can keep it .
My advice to you is adding prefix to calrify what type the procedure is .
Prefix :
gen - General: CRUD, mostly
rpt - Report: self-explanatory
tsk - Task: usually something with procedural logic, run via scheduled jobs
For example:
genInsOrderHeader
genSelCustomerByCustomerID
genSelCustomersBySaleDate
genUpdCommentText
genDelOrderDetailLine
rptSelCustomersByState
rptSelPaymentsByYear
tskQueueAccountsForCollection
For more information,please refer to:https://stackoverflow.com/questions/238267/what-is-your-naming-convention-for-stored-procedures
Best Regards,
Isabella
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.