Azure-Sql-Db

SQL: Does having more indexes always make data modifications slower?

SQL: Does having more indexes always make data modifications slower?

As I’ve pointed out in other posts, Betteridge’s Law of Headlines says you already know that the answer to this is no.

There is a persistent myth among SQL Server users that having more indexes always slows things down, particularly anything that needs to modify data (INSERT, UPDATE, DELETE, MERGE).

However, there are two aspects of this to consider:

The first is that you need to decide how much the modifications actually matter in the overall performance of the system. In an earlier blog post, I noted that when I trace typical transactional systems, I often see reads making up about 99% of page I/O’s. Writes barely even appear. I’m not saying they are irrelevant but you need to focus on what the system is spending most of its time doing.

2026-11-05

SQL: Which SQL Server columns should be nullable part 2: Avoid placeholder values

SQL: Which SQL Server columns should be nullable part 2: Avoid placeholder values

In a previous post , I was discussing why magic values were a problem. They are often added by developers when they are trying to avoid having any NULL data in a database.

While discussing this, I think it’s worth also highlighting the overall dangers of placeholder values. These are values that aren’t magic values but are ones that are intended to be replaced at a later time.

If you use any of these, you need to have a solid process in place to:

2026-11-03

SQL: Avoid using magic values instead of NULL

SQL: Avoid using magic values instead of NULL

A while back, I wrote about the ANSI_NULLS option for tables and after that I had several more questions related to NULL values.

Note that I mentioned NULL values, not values of NULL, and not values equal to NULL. That’s because being NULL is a state that a value is in, not itself a value. That’s why our queries say IS NULL and not = NULL.

Magic values

Now because of that, many developers see values that are NULL as a pain in the neck as they have to be dealt with separately, unlike other values. This can lead to many poor design decisions but I want to start today with the decision to use magic values.

2026-10-25

SDU Tools: Version 28 is now released for download

SDU Tools: Version 28 is now released for download

Version 28 of our free SDU Tools for developers and DBAs is now released and winging their way out to our SDU Insiders.

You can find details on the tools here .

If you haven’t been using SDU Tools yet, I’d suggest downloading them and taking a look. At the very least, it can help when you’re trying to work out how to code something in T-SQL.

This is a huge release of the tools.

2026-10-13

SDU Tools: Seconds to Duration in T-SQL

SDU Tools: Seconds to Duration in T-SQL

There are a few places in T-SQL where instead of a time value, you need to work with a duration.

An example is if I want to sleep for a short period. In T-SQL, we can do that with the WAITFOR statement, used like this:

This command would cause SQL Server to wait for 10 minutes. One of the challenges though, is how do I create this duration string in a programmatic way? For example, how do I create the string ‘00:02:00’ if I’m starting with a value of 120 seconds?

2026-10-11

SQL: Setting local date and time for Azure SQL Database

SQL: Setting local date and time for Azure SQL Database

I have previously posted information about how to get local date and time happening in Azure SQL Database. Many people have been frustrated about the inability to set any date and time to work with, rather than just UTC.

I posted here about calculating it, and here about how to set it for your session.

While the workarounds were helpful, there were many situations where they just weren’t enough. One simple example is where you’re offering a Software as a Service (SaaS) application and want each tenant database to have its own date and time configuration, but many other people just wanted their database to reflect their own local time.

2026-10-09

SQL: I can tell from your triggers if you write real production code

SQL: I can tell from your triggers if you write real production code

I’ve done a lot of Microsoft exams over the years, mostly SQL Server ones but plenty of others too. And one thing that I really don’t like is when the questions are:

  • Purely academic (ie: would never happen)
  • Memory-based (ie: who cares what a particular limit is for a particular SKU today?)
  • Clearly not written by someone who actually uses the product

Today, I want to mention an item in the last category.

2026-10-01

SQL: Are big SQL Server databases really slower?

SQL: Are big SQL Server databases really slower?

One question that I’m asked all the time when consulting is whether reducing the size of database tables will make queries run faster or not.

The underlying question is typically about whether the client should implement some sort of archiving strategy, to reduce the amount of data in a table by moving older data off into another table.

My answer is that it might help, but if it does, you probably have another issue that would be a better one to solve instead.

2026-09-29

SQL: Should I focus on reads or writes in SQL Server?

SQL: Should I focus on reads or writes in SQL Server?

I’m involved in a lot of performance tuning work for SQL Server based applications. These are mostly your typical OLTP accounting, financial, or record keeping applications. One thing that constantly surprises me is that many developers and DBAs really aren’t sure about where their tuning efforts need to be focused.

In particular, what really surprises me is how much focus most people have on write/update behavior and how little on read behavior. I think there’s a perception problem.

2026-09-27

SQL: Design – Entity Attribute Value Tables (Part 2) – Pros and Cons

SQL: Design – Entity Attribute Value Tables (Part 2) – Pros and Cons

In an earlier post , I discussed the design of EAV (Entity Attribute Value) tables, and looked at why they get used. I’d like to spend a few moments now looking at the pros and cons of these designs.

Let’s use the same table as the last time as an example:

Pros

The main positive that’s typically described is that the schema is flexible. By this, the developers usually mean I don’t have to change the database schema (or worse, have someone else change it) when my needs change.

2026-09-21