T-SQL Coding Standards

Hi Folks,


Just posted this to our local SQL Down Under mailing list. If anyone not on the list wishes to contribute, that would be appreciated. Coding standards usually bring strong opinions. We’re keen to really thrash out current best practices.







Hi Folks,


I see a wide variety of coding standards in place (and often none) when reviewing systems at customer sites. Within the MSDN communities, we have some coding competitions coming up and we want to put coding standards in place for these, to maximise the ability to reuse code submitted to the competitions. Initially, I’m looking at C#, VB.NET and T-SQL coding standards.


For this list, I’d like to kick around T-SQL coding standards. What I’m proposing is this:


Step One: Gather existing lists


If anyone has existing T-SQL coding standards they wish to share (and are allowed to do so), please email them to me. Please also provide pointers to any sites you think have good published T-SQL coding standards.


Step Two: Discussion


I’ll then break them into categories and send an email for each category (one at a time) to this list with a specific heading (so those that aren’t interested can ignore it easily), covering the issue and a summary of the arguments from various submitted standards. We can then discuss each of these as necessary to come up with a best practice.


Step Three: Publish


I’ll put the resultant list of standards up on www.sqlserver.org.au for all to use/ignore as they see fit, but we’ll use them for any T-SQL in any of the coding competitions. Hopefully it will also provide a good resource for anyone needing to implement standards or reevaluating their own standards.


Also, if anyone wants to suggest a different way of doing this, please let me know as well.






5 thoughts on “T-SQL Coding Standards

  1. Hi Greg

    I have put all my Naming Conventions which include:

    – SQL Server Object Naming Conventions

    – SQL Server Index Naming Conventions

    – SQL Server Relationship Naming Conventions

    – SQL Server Stored Procedure Naming Conventions

    – SQL Server Stored Procedure Formatting Standards

    – .NET Object Naming Conventions

    – .NET Project Naming

    up at http://www.ssw.com.au/ssw/Standards/

    I would love to know what you disagree with

    PS: I also enforce quite a few of them with a tool ‘SSW SQL Auditor’

    Cheers Adam

    a d a m c o g a n @ssw.com.au

  2. Hi,

    I liked Adam Cogan’s collection of standards information. I tried looking up for Greg’s resultant list of standards up on http://www.sqlserver.org.au, but couldn’t locate. Is it up there yet or not? Please let me know.


    Pankaja Shankar

Leave a Reply

Your email address will not be published. Required fields are marked *