formatting

External Article

The Basics of Good T-SQL Coding Style – Part 4: Performance

  • Article

There are several obvious problems with poor SQL Coding habits. It can make code difficult to maintain, or can confuse your team colleagues. It can make refactoring a chore or make testing difficult. The most serious problem is poor performance. You can write SQL that looks beautiful but performs sluggishly, or interferes with other threads. A busy database developer adopts good habits so as to avoid staring at execution plans. Rob Sheldon gives some examples.

2017-10-05

6,056 reads

External Article

The Basics of Good T-SQL Coding Style – Part 2: Defining Database Objects

  • Article

Technical debt is a real problem in database development, where corners have been cut in the rush to keep to dates. The result may work but the problems are in the details: such things as inconsistent naming of objects, or of defining columns; sloppy use of data types, archaic syntax or obsolete system functions. With databases, technical debt is even harder to pay back. Robert Sheldon explains how and why you can get it right first time instead.

2017-07-25

5,860 reads

External Article

The Basics of Good T-SQL Coding Style

  • Article

TSQL Code must work properly and efficiently. That's not enough though. Unless you are working alone, have perfect memory and plan to never change job, then you need to comment and document your code, it must be inherently readable, well laid out, use informative and obvious names, and it must be robust and resilient; written defensively. It must not rely on deprecated features of SQL Server, or assume particular database settings. Robert Sheldon starts a series of articles that explains the basics.

2017-07-05

7,732 reads

External Article

Who the Devil Wrote This SQL Code?

  • Article

The way that you format T-SQL code can affect the productivity of the people who have to subsequently maintain your work. It is never a good experience to see SQL Code, cry out “Who the devil wrote this code?”, and then realise that it was you. Grant gives some examples of bad formatting and explains why you should never check-in badly-formatted SQL code.

2016-11-29

6,105 reads

External Article

Formatting SQL Code - Part the Second

  • Article

When you're formatting SQL Code, your objective is to make the code as easy to read with understanding as is possible, in a way that errors stand out. The extra time it takes to write code in an accessible way is far less than the time saved by the poor soul in the future, possibly yourself, when maintaining or enhancing the code. There isn't a single 'best practice, but the general principles, such as being consistent, are well-established. Joe Celko gives his take on a controversial topic.

2016-08-30

8,612 reads

Blogs

Daily Coping 7 Dec 2022

By

Today’s coping tip is to stop for a minute when you walk outside and...

Encryption and Data Protection Regulation

By

One of the reasons you may be considering encryption is due to the relevant...

Types of data consulting engagements and what you can expect from them

By

There are multiple ways organizations can engage with a data (DBA/analytics/data architect/ML/etc.) consultant. The...

Read the latest Blogs

Forums

Blocking

By sqlguru

We were getting constant blocking on the db server. However, after stopping the process...

record loading

By Bruin

I have a table from a Linked Server that I'm pulling data and would...

Either/ Or Query

By dec_obrien

Hi, I have a table containing some columns and some simple data. I want...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers