Resources

SQL Server Diagnostic Queries

SQL Server Diagnostic Queries

Here are links to the latest versions of these diagnostic queries for Azure SQL Managed Instance, Azure SQL Database, SQL Server 2022, SQL Server 2019, SQL Server 2017, SQL Server 2016 SP2, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.

All of the SQL Server Diagnostic queries will also work on IaaS virtual machines and Azure ARC.

There are two separate links for each version of the queries. The first one on the top left is the actual diagnostic query script, and the one below on the right is the matching blank diagnostic results spreadsheet, with labeled tabs that correspond to each query in the set.

Azure Diagnostic Queries

SQL Server Diagnostic Queries

Legacy SQL Server Diagnostic Queries

I have a series of YouTube videos that explain how to interpret the results of these queries in more detail. Here is the first in the series.

SQL Server 2019 Diagnostic Queries Part 1

Jupyter Notebooks

These are links to Jupyter Notebook versions of my Diagnostic Information Queries. These have additional information and formatting compared to automatically generated versions.

SQL Server Diagnostic Information Notebook
SQL Server Diagnostic Information Notebook

Azure Diagnostic Queries

SQL Server Diagnostic Queries