Recently, one of my clients’ Comprehensive Database Performance Health Check asked me if I know a way to export any query as JSON with SSMS.
Year-Over-Year Comparisons in One Query
Build year-over-year monthly comparisons with a complete calendar, LAG, date-aligned joins, safe percentages, and missing-period rules.
QDS_LOADDB Wait: Slow Startup and Query Store Load
A QDS_LOADDB wait means a database waits for Query Store to load its data at startup. This post reads the wait, checks the size of a store, explains the trace flag that loads Query Store asynchronously, and shows the settings that keep a store small.
Give Memory Back to the OS? Why SQL Server Doesn’t
This is a guest post by Brian Gale. It explains why SQL Server doesn’t give memory back to the OS, what the buffer pool keeps in that memory, and why max server memory needs a realistic value. Two queries show what is held right now.
ORDER BY a Parameter in SQL Server: CASE, Types and Plans
To ORDER BY a parameter in SQL Server, write one CASE expression for each column and direction. This post builds the procedure, shows the type conversion and DISTINCT errors that trip people up, measures the cost of the sort that CASE forces, and compares OPTION (RECOMPILE) and dynamic SQL.
How to Find IP Address of All SQL Server Connection? – Interview Question of the Week #280
Question: How to Find the IP Address of All SQL Server Connection?
I had recently received this question during a recent consultation.
Restore From LDF File Only: Why It Fails and What Works
A restore from LDF file only is not possible, because a log holds changes and not the database. This post answers five common questions, shows the error SQL Server gives, and restores a database from a full backup, a log backup and a tail-log backup.
Second Identity Column Workaround: Computed Column or Sequence
A SQL Server table can have only one identity column, and a second one fails with Msg 2744. This second identity column workaround compares a computed column with a sequence, shows what each does with gaps, rollbacks and large values, and explains when to pick which.
Kill a Running Shrink: Is It Safe to Stop DBCC SHRINKFILE?
You can kill a running shrink with KILL and the database stays safe. This post starts a shrink on a test database, stops it from a second window, checks the data and the file afterwards, and shows that the shrink itself, not the kill, is what fragments the table.
Partition Function Fanout: Count Partitions in SQL Server
Count partitions in SQL Server by reading the fanout of a partition function. This post reads fanout and modify_date from sys.partition_functions, watches SPLIT RANGE and MERGE RANGE change them, and finds functions that no table uses.










