Sql-Server

SQL: Log Shipping Between SQL Server Versions

SQL: Log Shipping Between SQL Server Versions

One of the discussion lists that I participate in, had a brief discussion the other day about whether or not it’s possible to perform log shipping between differernt versions of SQL Server.

Specifically, can you do log shipping between SQL Server 2017 and SQL Server 2025?

Partial success

SQL Server does support restoring earlier version databases on later versions of the product. The databases get upgraded along the way when you perform restores of databases. SQL Server also allows you to restore transactions logs from earlier versions of the product but the upgrade doesn’t happen until recovery of the database occurs. And that’s why you can’t use STANDBY mode in this situation.

2026-02-09

SQL: sys.dm_fts_parser for Full-Text Word Breaking

SQL: sys.dm_fts_parser for Full-Text Word Breaking

One of my favorite DMFs that most people seem to be completely unaware of, is sys.dm_fts_parser(). It allows you to see the result of the word-breaking occurring within full text search. If you execute the query:

SELECT * 
FROM sys.dm_fts_parser('"Hello Greg. How are you? I haven''t seen you for a while."', 1033, 0, 0);

It returns the following data (along with some other columns):

occurrence special_term display_term
1 Exact Match hello
2 Exact Match greg
10 End Of Sentence END OF FILE
11 Noise Word how
12 Noise Word are
13 Noise Word you
21 End Of Sentence END OF FILE
22 Noise Word i
23 Exact Match haven’t
24 Exact Match seen
25 Noise Word you
26 Noise Word for
27 Noise Word a
28 Noise Word while
36 End Of Sentence END OF FILE

That’s really impressive as it lets you parse text into words. The 1033 was the locale I chose (for US English) and the other two parameters were a stop word list (formerly called a noise word list) and whether or not it should be accent sensitive.

2026-02-03

SQL: Practical SQL Server Encryption - TDE, Always Encrypted, and When to Use Each

SQL: Practical SQL Server Encryption - TDE, Always Encrypted, and When to Use Each

Encryption in SQL Server is often discussed as a checklist item:

  • Is the database encrypted?
  • Do we need Always Encrypted?
  • What does compliance require?

What gets discussed far less often is how these features behave in real systems, what problems they actually solve, and what trade-offs they introduce.

This post looks at Transparent Data Encryption (TDE) and Always Encrypted from a practical standpoint: what each one protects, what it doesn’t, and how to decide which one belongs in your design.

2026-02-01

SQL: How SQL Server Really Uses the Service Master Key

SQL: How SQL Server Really Uses the Service Master Key

The Service Master Key (SMK) is one of the most misunderstood security components in SQL Server.

It is frequently described as:

  • The root of all encryption
  • The key that protects everything
  • Something you must back up constantly

Those statements are not entirely wrong - but they are incomplete, and in some cases actively misleading.

It’s important to understand what the Service Master Key actually does, when it matters, when it doesn’t, and why many operational decisions around it are based on myth rather than mechanics.

2026-01-30

SQL: Common Anti-Patterns that Stop Parallelism

SQL: Common Anti-Patterns that Stop Parallelism

One of SQL Server’s greatest strengths is its ability to execute queries in parallel. When parallelism is available, the engine can divide work across multiple CPU cores and dramatically reduce query duration for large or complex workloads.

Yet in real systems, it’s surprisingly common to find queries that could run in parallel but don’t. The reason is often not hardware, configuration, or cost threshold settings — but query anti-patterns that quietly force the optimizer into a serial plan.

2026-01-26

SQL: Tempdb, Temporary Tables, and Collation: A Design Trap You Can Avoid

SQL: Tempdb, Temporary Tables, and Collation: A Design Trap You Can Avoid

One of the more frustrating classes of SQL Server application failures is also one of the most avoidable: collation conflicts involving tempdb.

Background

I see these issues all the time. Developers create applications that require specific collations at the server level, because they don’t handle temporary tables (and by extension) tempdb well.

All this can be avoided, and you can easily build applications that will work with temporary tables, without worrying about the server (and tempdb) collation.

2026-01-26

Data Tales 13: The case of the invisible brake

Data Tales 13: The case of the invisible brake

This is the thirteenth tale in a series of stories about data. I hope you enjoy the series.

Today’s tale relates to a SQL Server system that had wonderful hardware, yet was unbelievably slow. Let’s discuss what happened.

Some background information

I had a call from the Microsoft office in Brisbane, Queensland, asking if I had time to look at a problem at a customer site. Both they, and the customer, had thrown considerable resources at trying to resolve a performance problem, but frustratingly, it persisted.

2026-01-24

SQL Interview: 104 Backup restore time

SQL Interview: 104 Backup restore time

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Advanced

Question:

A database backup was started at 12:00 PM. It completed at 2:00 PM.

When the backup is restored, at what time point will the restored data be?

  • 12:00 PM
  • 2:00 PM
  • Somewhere between 12:00 PM and 2:00 PM

Answer:

2026-01-20

SQL Interview: 112 Trigger and constraint execution order

SQL Interview: 112 Trigger and constraint execution order

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Medium

Question:

You have tables that have both constraints and triggers. You need to explain the order of execution for these. Which execution order (from first to last), are used for:

  • Check constraints
  • After triggers
  • Instead of triggers

Answer:

2026-01-18

SQL Interview: 111 Simple recovery and log truncation

SQL Interview: 111 Simple recovery and log truncation

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Advanced

Question:

If a database is configured for simple recovery model, what could stop the truncation of the transaction log being effective, and for the transaction log to keep growing in size?

Answer:

Here are the most frequent reasons:

2026-01-16