Sql-server – T-SQL Naming Standard

naming conventionsql servert-sql

Is there a recommended (official or not) style from Microsoft regarding naming and casing in T-SQL?

If there isn't one from Microsoft then is there one with broad acceptance?

Best Answer

There's no broad standard that I've seen used or heard widely recommended. Some recommend prefixing tables with tbl but some are very against that. Some, like myself, prefer to name the ID column simply so you always know what the ID column of any table will be called ID while others, like my coworker, prefer to put the tablename (ie - serverid) so what it's called in another table matches the column name in the parent table.

The most important thing is that the scheme you use remains consistent, especially within the same database. Most DBAs can pick up on the naming format as long as it doesn't change within an environment.