ktaranov / sqlserver-kit

Useful links, scripts, tools and best practice for Microsoft SQL Server Database
http://sqlserver-kit.org
MIT License
2.14k stars 669 forks source link

Database object naming convention #215

Closed Deilan closed 1 year ago

Deilan commented 1 year ago

Regarding SQL Server Object Name Convention @ SQL Server Name Convention and T-SQL Programming Style:

SQL Server Object Name Convention

Object Code Notation Length Plural Prefix Suffix Abbreviation Char Mask Example
[Database] UPPERCASE 30 No No No Yes [A-z] MYDATABASE

Could you please explain where this particular database naming convention comes from? I've never seen database named in UPPERCASE notation, nor I've seen any conventions proposing to name databases in uppercase. The most common case I'm aware of is to name in snake_case (my_database in this example). Even the referenced article on database creation uses snake_case notation:

CREATE DATABASE database_name
ktaranov commented 1 year ago

It's just our choice, due to the convenience of reading large T SQL scripts - we want to see all changes and mentions of databases by capslock, it's convenient for us. You can use any notation in your team, the main thing is that everyone adheres to it.

ktaranov commented 1 year ago

Microsoft in its learning database recommended PascalCase notation.