June 18, 2018
SQL Server Support

What’s the plan when you don’t know how to fix a production issue? You can prepare this situation by reading and keeping up to date. But when you’re sweating behind a keyboard, you haven’t moved out your chair for 4 hours and you’re being chased for an update, what do you do?... I thought I'd […]

Logging sp_whoisactive to a table
May 21, 2018
Logging sp_whoisactive to a Table

This is a follow-on post of sp_who, sp_who2 & sp_whoisactive and is a run-through of logging SQL Server activity to a table, using the sp_whoisactive stored procedure. Even if you are equipped with a SQL Server monitoring tool, you still may be having trouble finding that slow/blocking query that runs during the night. Running sp_whoisactive […]

May 21, 2018
sp_who, sp_who2 & sp_whoisactive

Sp_whatnow? sp_who, sp_who2 and sp_whoisactive are stored procedures that allow you to view current users, sessions, and processes within a SQL Server instance. You'd want to see this for identifying things like blocking or checking general activity. sp_whoisactive is definitely one of my favourite stored procedures. Created by Adam Machanic, this tool gives you an […]

Study Blog
May 19, 2018
Geographical Spatial Environmental Mental

The title is just words thrown together. I'm glad you noticed. This post is the start of a "Study Blog" category, which is more or less a scribble pad for when I'm watching a video or reading stuff. My thoughts recently have been with the 70-461 Querying Microsoft SQL Server 2012/2014 exam. I was converted […]

SQL Server Go To Line
May 16, 2018
Show Line Numbers in SQL Server Management Studio

This is a tip on how to show line numbers in your SQL Server Management Studio (SSMS) query window. This can be useful for when you receive an error with reference to a line in your code, although it’s not a necessity having it enabled as you’ll see below. I’ve created a simple script to […]

SQL Script Case When
May 13, 2018
Get Disk Space of a SQL Server

You can quickly check disk space info on a SQL Server host by running the query below. I sometimes find this the quickest way to check available space rather than using PowerShell or the Windows GUI. This SQL Script only work on SQL Server 2008 R2 and above. [crayon-5cc16ecf4ae3e513284454/] The query result will be returned […]

Kill SQL Server SPIDs
April 17, 2018
Killing SQL Server Processes (SPIDs)

There are many reasons why you’d KILL a SPID in SQL Server. Whether it’s impending disk space doom due to data or log file bloat, or a long running query that’s lost in space... When alerted to this situation I’d run sp_whoisactive in the first instance. When the picture is clear, the kill happens. To […]

Quill and ink image
April 16, 2018
Renaming a computer that hosts SQL Server

When changing the hostname of a computer running SQL Server, system metadata must be updated so that remote connections and applications do not lose connectivity. Those that use @@SERVERNAME or query sys.servers for the hostname that is. Microsoft's documentation pages are a must read as always. Some considerations include; failover clustering, mirroring, replication, SSRS, local authentication […]

Microsoft SQL Server Logo
April 15, 2018
Installing SQL Server 2017

Installing SQL is a straight-forward task… but it’s important that things are in-place from the get-go to prevent having to make changes on a live system. There are a few best practises that can be defined within the installation wizard and many to be applied post install. This is a basic guide on installing SQL […]