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

Why I Support Code Automation Tools Like ORMs

By

I know I’m a weirdo. I’ve always been a weirdo. When I was a...

#PowershellBasics: Run a file and pass it a parameter.

By

I realized in my last #PowershellBasics post that I was talking about running a...

SQL Undercover TV – Instant File Initialisation

By

Adrian has a look at the performance benefits of instant file initialisation Below is...

Read the latest Blogs

Forums

SQL Backup and Restore

By Jackie Lowery

  We recently got hit by a ransomware attack.  The SQL server is hosed,...

Add two rows to a view

By Ken at work

I'm creating a view of individuals in a department. That is easy. Select p.PREmp,...

query to check the duplicates

By mcfarlandparkway

i have a table, where a column ABC holds value 123 , based on...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

DBCC Meaning

See possible answers