Code formatting

External Article

Laying out SQL Code

  • Article

It is important to ensure that SQL code is laid out the best way for the team that has to use and maintain it. Before you work out how to enforce a standard, one has to work out what that standard should be for the application. So do you dive into detail or create an overall logic to the way it is done?

2010-02-05

4,843 reads

External Article

Transact-SQL Formatting Standards (Coding Styles)

  • 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 anyway 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-08

4,913 reads

Blogs

SQL Saturday Baton Rouge 2025

By

SQL Saturday Baton Rouge is a great event hosted on LSU’s campus that has...

Responsible AI: Why Leaders Need More Than Just Guardrails

By

In the rush to adopt artificial intelligence, many organizations have quickly built ethical frameworks,...

TempDB Performance Tuning in SQL Server 2022 vs 2016 vs 2019

By

📘 What Is TempDB and Why It Matters TempDB is a shared system database in SQL...

Read the latest Blogs

Forums

How a Legacy Logic Choked SQL Server in a 30-Year-Old Factory

By Chandan Shukla

Comments posted to this topic are about the item How a Legacy Logic Choked...

When DBAs Should Consider Using SQL Server to Store Vector Data and If It Makes Sense

By dbakevlar

Comments posted to this topic are about the item When DBAs Should Consider Using...

Row Count task in data flow fails with "unspecified error"

By Gergely Mészáros

Hi all, I have a data flow task with: Flat File Source (csv) ->...

Visit the forum

Question of the Day

Capacity Planning for an Existing SQL Server Workload?

You're tasked with planning capacity for a new SQL Server database workload. Which of the following is the most accurate way to determine how much CPU, memory, and I/O throughput your workload requires?  What single or multiple tools would you use to answer the questions around resource needs?

See possible answers