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

Check Azure SQL DB Space Used

By

A couple of days ago I was doing some cleaning on some Azure SQL...

Use a slicer to filter a visual based upon a measure in Power BI

By

Have you ever wanted to filter a visual by selecting a range of values...

Deleting Stale Local Database Git Branches with SSMS–#SQLNewBlogger

By

I wrote a post recently about pruning branches in git. That’s part of the...

Read the latest Blogs

Forums

SSRS Web Service URL - getting rid of HTTP

By cphite

Not sure if this is the place to ask, but will give it a...

SQL Server software and windows version compatibility level

By Abhishek

Is there a specific platform or website where I can verify the compatibility between...

Truncate tables where Referential Integrity exists

By Perry Whittle

Comments posted to this topic are about the item Truncate tables where Referential Integrity...

Visit the forum

Question of the Day

Post Restore Tasks for the Resource Database

I backup the Resource database from my SQL Server 2022 instance. I then install CUs 1, 2, 3, and 4. I have an issue and need to restore my Resource database from backup. Is there anything I need to do after restoring this database?

See possible answers