Latest Posts

Setting Up a Windows Cluster

In this post, we’ll walk through setting up a Windows Server Failover Cluster (WSFC). This is a requirement of SQL Server Availability Groups, something which we’ll be using on this blog and so I will be setting one up that can be used in the home lab I use to write my blogs. A Windows…

Keep reading

Setup a Non-Domain Windows Cluster

This post documents the process of setting up a non-domain Windows Server Failover Cluster, officially known as a Workgroup Cluster. The process is similar to Setting Up a Windows Cluster, however there is a slight difference in this scenario which is that the nodes in the cluster are not part of an Active Directory domain.…

Keep reading

Setting Up an Active Directory

In this post, we’ll walk through the process of how I set up an Active Directory (AD) in my home lab. I know, this blog is normally database focused, so why are we looking at Active Directory? Well, yes, it isn’t strictly database related. However, where there is an enterprise SQL Server estate, there is…

Keep reading

Installing SQL Server on Linux

SQL Server on Linux – one of those things that you can’t believe actually exists – two worlds you never thought would collide. For years, Microsoft and Linux were very much apart, until the announcement in 2015 that Microsoft Loves Linux. SQL Server on Linux was launched in 2017 and whilst I won’t get into…

Keep reading

How SQL Server Solves the Halloween Problem

It’s that time of year again when ghouls and spooks surface and database bloggers write about an issue that shares its name with Halloween. Around mid to late October, you often come across database blogs about a phenomenon that dates all the way back to the mid-1970s: the Halloween Problem. This is my take on…

Keep reading

Seasonal Clock Changes and SQL Server

In this post we’ll look at the behaviour of a SQL Server application that needs to deal with events that are logged over the period of a UK clock change where the clocks change from GMT (Greenwich Mean Time) to BST (British Summer Time). The Problem Let’s say we have an events table with a…

Keep reading

Upgrading PostgreSQL on Debian Linux with pg_upgradecluster

In my previous post, we upgraded a PostgreSQL 15 cluster to version 18 using pg_upgrade. In this post, we’ll contrast that with using pg_upgradecluster. As before, the upgrade process is: Note that we have one less step than the pg_upgrade version, that step being creating the new cluster. The environment is the same as before:…

Keep reading

Using Files in UNC Paths with PowerShell in SQL Server Agent

In this post, we’ll look at how PowerShell job steps may have issues connecting to network locations from within SQL Server Agent job steps. Timeless Backup Job When working with SQL Server backups, I bet we’ve all seen agent jobs that look like this: It’s a classic backup job – run the backup using T-SQL…

Keep reading

Upgrading PostgreSQL on Linux with pg_upgrade

In this post, we’ll look at how to upgrade a PostgreSQL installation on Linux. In this example, we’ll look at an in-place upgrade on Debian from PostgreSQL version 15 to 18. The version 15 cluster will already be up and running and we’re going to use pg_upgrade to do it. The upgrade process is: The…

Keep reading

Left join pitfalls – LEFT JOIN + INNER JOIN = INNER JOIN

This post is a quick public service announcement to serve as a reminder to be careful with joins in SQL, particularly in queries with a large number of INNER and LEFT JOINs. An INNER JOIN onto a LEFT JOIN will effectively make that LEFT JOIN an INNER JOIN. Example The test query below is against…

Keep reading