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.