May 16, 2018
Show Line Numbers in the SSMS Query Window

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 […]

May 13, 2018
Get Disk Space in 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-5c709bac23792598211303/] Results should return within a blink […]

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 […]

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 […]

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 […]

April 9, 2018
Get Estimated Database Restore Time

If you're backing up or restoring a large database, you can run the script below to find out how long it has left to complete. The performance of a backup or restore will depend on many things such as server hardware, chosen backup options or even a user running queries. The estimated time returned by […]