New Zealand's new Copyright Law presumes 'Guilt Upon Accusation' and will Cut Off Internet Connections without a trial. is against this unjust law - help us

A Space for All Things .NET Related

T-SQL Interactive Coding Standards

By James Hippolite, in , posted: 7-Dec-2008 12:43

T-SQL Interactive Coding Standards  Why?
  • Maintainable Code
  • Easy to read, easy to understand
 A few standards to whet your appetite
  • CAPITALISE keywords
  • Indent your code
  • Comments, comments & more comments
  • Do not cal functions repeatedly
  • No anonymous inserts
  • Don’t use select *
  • Avoid using not equals operators
  • Don’t use hard-coded values
  • Catch errors
 Ideas time…
  • Put URLs of pages you’ve followed in code
  • Use transactions where appropriate
  • Name your transactions – helps with debugging
  • Segment your code into sections
  • Don’t put JOINs into the WHERE clause
  • Columns in neat orders
  • Don’t use one line statements
  • Debug tables
  • Cursors are a necessary evil?  (Don’t know if I agree with this)
  • Table variables vs. Temp tables (work out which one is appropriate)
  • Indexing
  • Pseudo code in comments

Other related posts:
GeekPost Weekly Newsletter Volume 4 Issue 7
MSDN Unplugged Roadshow Wellington
Right Sizing Agile Development - MSDN Magazine Webinar

Add a comment

Please note: comments that are inappropriate or promotional in nature will be deleted. E-mail addresses are not displayed, but you must enter a valid e-mail address to confirm your comments.

Are you a registered Geekzone user? Login to have the fields below automatically filled in for you and to enable links in comments. If you have (or qualify to have) a Geekzone Blog then your comment will be automatically confirmed and shown in this blog post.

Your name:

Your e-mail:

Your webpage:

JamesHip's profile

James Hippolite
New Zealand

Welcome to my technical blog. 

Here, I attempt to distill the Microsoft Certified Professional Developer knowledge I have accumulated since first qualifying MCP in 1996.  This blog started on 13 September 2007 as an off-shoot from my mixed up personal blog.  But it took a shot in the arm from Scott Hanselman's talk at TechEd New Zealand 08 "32 Ways To Make Your Blog Suck Less".