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

Power BI – Hungry Median – Aggregations

By

Introduction In my last blog post, I have addressed an issue with DAX Median...

Inspector 2.4 now available

By

All the changes for this release can be found in the Github Project page...

Basic JSON Queries–#SQLNewBlogger

By

Another post for me that is simple and hopefully serves as an example for...

Read the latest Blogs

Forums

SSIS Startup directory not found

By wburke 85918

This seems to be a common issue throughout my packages. Anywhere I try to...

What is the best way to create events from table inserts in SQL Server

By Joseph Termine

I have a SQL 20XX database in an on-premise data center that has a...

HA in General Purpose Managed Instance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item HA in General Purpose Managed...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers