Coding Standards

Transact-SQL Formatting Standards

  • Article

How should SQL code be formatted? What sort of indentation should you use? Should keywords be in upper case? How should lists be lined up? SQL is one of those languages that will execute however you treat whitespace and capitalization. However, the way SQL is laid out will effect its readability and the time taken to review and understand it. Standardisation of code layout is an important issue, but what standard should you adopt? Rob avoids a direct answer, but tells you the sort of answers you'll need to decide upon when creating a strategy for formatting SQL code.

2009-09-09

4,890 reads

Blogs

SQL in the City Back in London

By

It’s just a couple weeks until the SQL in the City Summit comes back...

Azure Fundamentals 12th December

By

Certified Microsoft Azure Fundamentals  - AZ-900  1 day Web based Course - 12th December 2019 Its...

"Think Like a Certification Exam" at the PASS Marathon!

By

Thanks to the 56 of you who joined and actively answered my nerdy sample...

Read the latest Blogs

Forums

A bit of mathematics...

By JaybeeSQL

Hi all, I'm just doing some work on my own bank statements imported from...

Need Help: On Query with Case Statement

By windows_mss

Hi, As part of development task I have to write a SQL logic for...

Value of extended property in T4 script returns a quoted, escaped string?

By rolandpater

  Hi, I have a T4 script which reads extended properties. The value of...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers