sqlsunday.com

T-SQL programming, useful tips and tutorials for the MS SQL Server developer.

Skip to content
  • About sqlsunday.com
  • Structured Concepts
    • Master data tool
    • File parser API
  • Slack app
  • Presentations
  • Downloads
  • Checklists
    • Installing SQL Server 2014
    • Installing SQL Server 2016
    • Installing SQL Server 2017
    • Links and utilities
Search

histogram

How to build a histogram in T-SQL

2014-09-142014-07-25 / Daniel Hutmacher / 1 Comment

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.

Continue reading →

Categories

  • By difficulty (168)
    • Advanced (37)
    • Basics (46)
    • Intermediate (87)
  • CLR (1)
  • Off-topic (9)
  • Rant (4)
  • Scripts (17)
  • Series (28)
    • Efficient data (7)
    • Introduction to T-SQL (1)
    • Slowly changing dimensions (5)
    • SQL Server security (15)
  • SQL Server concepts (71)
  • T-SQL (120)
  • Tips (47)
  • Uncategorized (1)
  • Videos (2)

Search for articles

Create a website or blog at WordPress.com