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

Daily Coping 18 Sep 2020

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Optimize for Unknown for Inline Table-Valued Functions

By

I had a curious performance issue today. An inline table-valued function (iTVF) was performing...

Daily Coping 17 Sep 2020

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

SQL Query - FULL JOIN multiple tables but return NULL results

By glennyboy

Good day! Need help with my sql query code; first FULL JOIN "ILEtransfer" no...

Coping with a working life as an imposter

By Phil Factor

Comments posted to this topic are about the item Coping with a working life...

SQL Select with condition

By Dee Dee-422077

Hi, In my sql table,  there is a column which have string of text...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers