Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
steppinthrax
Starting Member
27 Posts |
Posted - 2010-01-07 : 16:03:20
|
Hello guys, this question is easily answerable. However, I'm looking for the best answer. Regarding objects within the SQL server (tables, Stored procedures, functions, constains) what are good naming conventions. Or what is the INDUSTRY STANDARD for most companies that are a well respected and tested set of standards. I've heard everything from no underscores, CaMeL case etc.... |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2010-01-07 : 16:12:04
|
We use the following:usp_ (application stored procedures)isp_ (DBA stored procedures)rsp_ (stored procedures used for reports)v_ (views)udf_ (functions)cidx_ (clustered indexes)uniq_ (unique indexes)idx_ (non-unique, non-clustered indexes)PK_TableName (primary key constraint)FK_Table1_Table2 (foreign key constraint)chk_ (check constraints)We do not prefix table names.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog"Let's begin with the premise that everything you've done up until this point is wrong." |
|
|
shan
Yak Posting Veteran
84 Posts |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-01-07 : 21:17:12
|
quote: Originally posted by tkizer We do not prefix table names.
Every time I see a table prefixed "tbl" I want to gag or scream lol. Anyone who can't recognize a table in context needn't access any database I'm responsible for |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|