Categories
SQL Server

The Halloween Problem and SQL Server

It’s not the usual time of year to think about Halloween, but listening to Erik Darling and Kendra Little recently on the Dear SQL DBA podcast they mentioned a completely new topic to me: Halloween protection. No, it doesn’t prevent horrors in your code, or shops putting out festive decorations in October. It’s actually much more interesting and thought it was worth […]

Categories
SQL

Understanding Return Types with ISNULL and COALESCE

Last week we looked at how expressions are evaluated with the ISNULL and COALESCE functions. Whilst we’re in the area it’s worth running through how data types are selected for them too. It might have implications with how you implement them. The way these functions choose which data type to return differs, so they aren’t direct swap outs for each other, […]

Categories
SQL

Understanding Expression Evaluation with ISNULL and COALESCE

When eliminating NULL values with SQL Server queries we typically reach for ISNULL or COALESCE to do the job. Generally speaking they’ll provide equivalent results, but they work in different ways. If you’re dealing with logic more complex than ISNULL(ColA, ColB) – for example using a function or subquery as part of the expression – then you might be in for a surprise. […]

Categories
SQL Server

The Cost of Convenience with the Import Data Wizard

If you need to create a copy of a table in another database, the ‘Import Data’ option may seem convenient. If you’ve used this method to copy to your dev environment and found things break, this post is for you. By letting the wizard create the destination table automatically, you might find your schema is […]

Categories
SQL

Exploring Regular Expressions in SQL Server 2025

String parsing is a regular occurrence when it comes to data engineering. Splitting strings, converting, combining – all in an effort to bring some order. Sometimes we need a more powerful tool, and that would be Regular Expressions (Regex). Regular expressions are something I have a fondness for under the right conditions, and with them being introduced […]

Categories
SQL Server

Discovering More About Join Operator Internals

In the previous post I explained Join Operators in SQL Server. Whilst compiling that I dug a little deeper and came across a few interesting points I thought were worth sharing. Let’s look at behaviour of the operators which may occur under specific conditions. Hopefully you find them as interesting as I did: Optimised nested loop […]

Categories
SQL Server

SQL Server Join Operators Explained

When reviewing our execution plans we’ll see joins executed using different operators. The type of operator is chosen based on the data that’s available to join and how the optimiser wants to execute it. In this post we’ll take a look at what the operators are, when they are used, and how they work. These […]

Categories
SQL Server

Fixing Orphaned Database Users

When restoring a database in different environments we may stumble across orphan users. This typically manifests through failed connections to the database. Here we’ll have a quick look at what the issue is and 3 ways to fix it. What are orphaned users When users are created in a database they’re mapped to the login […]

Categories
Azure

Legacy Problems for a Modern Solution: Establishing a Linked Server into Azure

Connecting different versions of SQL Server can allow us to combine or transfer data between environments. This can become a challenge when the versions are really different. Have you tried to connect SQL Server 2008 to a SQL database in Azure? – it can throw up a few curve balls. In this post we’ll look at how […]

Categories
SQL

You Probably Don’t Need ODBC Functions

This past week I stumbled across an ODBC Scalar Function for the first time. What was this which lay before me? Is that SQL with curly braces?! It returned the current date like this: It’s a function, but not quite as we know it. They’re surrounded by { curly braces } and prefixed with fn. The kind of thing I’d […]