Latest Posts

KILL and Query Store

I love Query Store. I like to think of it as SQL Server’s built-in monitoring tool and I use it a lot to look at query history in terms of run times and IO metrics. One thing I learned about Query Store recently is how it deals with queries that have been killed. Setting up…

Keep reading

Transaction Types

This post is just a quick reference post that outlines the three different types of transaction in Microsoft SQL Server. AutoCommit The default. Each statement in a batch works as though it had been individually wrapped in BEGIN TRAN / COMMIT so the following code block: is effectively the same as: This moves us nicely…

Keep reading

Four Flavours of Postgres Install – Part 1 (Linux)

This is the first post in a short series documenting the various methods of installing PostgreSQL. In this post, we’ll look at how to install PostgreSQL natively on Linux and connect to the cluster we install from a remote client. The VM Firstly, let’s create a VM to install PostgreSQL on. I won’t detail the…

Keep reading

Cross Database Deferred Name Resolution

I have been aware of temporary stored procedures in Microsoft SQL Server for a long time but never really had cause to use them, however, recently a need arose. I was testing what effect some index changes would have on a particular stored procedure. The testing was on a non-production server, and when I went…

Keep reading

#tsql2sday #200

This post is my first T-SQL Tuesday post since starting the blog a couple of months back. T-SQL Tuesday was originally set up by Adam Machanic, original creator of the essential sp_whoisactive stored procedure. The concept is that once a month, a different host puts out an invitation to the community for bloggers to write…

Keep reading

SQL Server – See What’s Executing Now With DMVs

In SQL Server, there are a few DMVs that tell us “What is running now”. This is built into SSMS as Activity Monitor, but I’ve never met anyone who actually finds that method useful, there’s also sp_who and sp_who2, but they are dated and limited in what they tell you. Instead, the more robust way…

Keep reading

Installing PGAdmin on Linux Mint

This is a quick walkthrough of how I installed pgAdmin on Linux Mint. pgAdmin is one of the main management and query tools for PostgreSQL, which I like to use in conjunction with DBeaver. Installation The pgAdmin tool isn’t in the standard Linux Mint repositories, only phpPgAdmin, which is a web-based tool, similar to the…

Keep reading

Schema Prefixing is Important

In this post, we’ll look at why it is important to prefix objects with their schema and look at an example where not prefixing objects with schemas can cause unexpected results. For this post, we’ll use the Northwind database, made available by Microsoft at the Northwind database repository on GitHub. I have made some modifications…

Keep reading