sqlsunday.com

T-SQL tips and tricks, best practices and query plans from the field.

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

distribution

How to fix rounding errors

2020-12-152021-01-18 / Daniel Hutmacher / 8 Comments

A number of business processes require you to distribute a value over a date range. However, if your distribution keys and values don’t add up perfectly or aren’t perfectly divisible, it’s very easy to get rounding errors in your distributions.

Continue reading →

Distributing values with overlapping ranges

2014-10-192014-09-23 / Daniel Hutmacher / 1 Comment

Today, we’re going to look at how to distribute values with what I call “overlapping ranges”. What I mean by that is that the value that you need to distribute has a given range and the objects you want to distribute the values to are also defined as ranges. Sound complicated? It doesn’t have to.

Continue reading →

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 →

Microsoft Most Valuable Professional
  • Mastodon
  • WordPress
  • LinkedIn
  • Twitter
  • Facebook
  • GitHub
  • RSS Feed

Search

Categories

  • By difficulty (201)
    • Advanced (42)
    • Basics (58)
    • Intermediate (103)
  • CLR (1)
  • Code review (1)
  • Datasets (1)
  • Off-topic (14)
  • Rant (6)
  • Scripts (20)
  • Series (33)
    • Efficient data (10)
    • Introduction to T-SQL (1)
    • Slowly changing dimensions (5)
    • SQL Server security (17)
  • SQL Server concepts (85)
  • T-SQL (148)
  • Tips (59)
  • Uncategorized (1)
  • Videos (2)
Daniel Hutmacher, Structured Concepts AB

SQL SERVER HELP YOU CAN DEPEND ON.

Need SQL Server help?

At Structured Concepts, we specialize in SQL Server development and performance tuning, as well as technical training for users and developers.

Visit our homepage at strd.co.

Mastodon
Create a website or blog at WordPress.com
  • Follow Following
    • sqlsunday.com
    • Join 184 other followers
    • Already have a WordPress.com account? Log in now.
    • sqlsunday.com
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar