Solved

SQL Server naming conventions

Posted on 2009-05-11
8
759 Views
Last Modified: 2012-08-13
Please review attached document, and indicate any issues you find and/or provide suggestion where required.


rSQL-Naming-Conventions-Standard.doc
0
Comment
Question by:robertkc
  • 5
  • 2
8 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 24361026
Hello robertkc,

i would prefer columnNames instead of Incremental numberwhich will be easier for you to identify
for example a foreign key can be like
     fk_MasterTable_ChildTable_ColumnName  (in case of column Names are the same )
    or
    fk_masterTable_ChildTable_MasterColumnName_ChildColumnName

same as index
idx_TableName_Column1_Column2


Regards,

Aneesh
0
 

Author Comment

by:robertkc
ID: 24361096
@aneeshattingalD

Reason for Incremental Number,
Is because there may be multiple columns on these objects. And at somepoint it may break your naming pattern, now your names will not follow a single pattern.

It also seems that the names may either get longer than is comfortable (and beyond server name limits at some point in time)

Based on these considerations, the alternative approach was to use incremental numbers.

0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24361115
the main advantage of putting the you can easily get the definition of the key from the name itself, if you put the numbers, then, you have to check the definition.
I agree, the name will be longer thats the disadvaantage
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:robertkc
ID: 24361227
To be honest I like your naming pattern and I was using your naming convention previously but was later told not to use it. -- name too long for multiple columns etc... = bad.
0
 

Author Comment

by:robertkc
ID: 24361239
0
 

Author Comment

by:robertkc
ID: 24362124
This should be the final version, unless im missing something.
SQL-Naming-Conventions-Standard-.doc
0
 
LVL 13

Assisted Solution

by:St3veMax
St3veMax earned 250 total points
ID: 24363099
Rob,

Here's a version I've written some time ago.

HTH
Document-Control.doc
0
 

Author Closing Comment

by:robertkc
ID: 31580397
Free points.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question