A visual representation of SQL Server Agent jobs

If all you have is a hammer, everything will eventually start looking like a nail. This is generally known as Maslow’s hammer and refers to the fact that you use the tools you know to solve any problem, regardless if that’s what the problem actually needs. With that said, I frequently need a way to visualize the load distribution of scheduled jobs over a day or week, but I could never be bothered to set up a web server, learn a procedural programming language or build custom visualizations in PowerBI.

So here’s how to do that without leaving Management Studio.

How to build a histogram in T-SQL

Talk to SQL Server developers or DBAs aboutĀ histograms, and they’ll inevitably think of index statistics. However, a task you may encounter some day is to calculate the distribution of numbersĀ in a table. And although there’s no quick built-in function to do this, it’s not as difficult as you may think.