Press "Enter" to skip to content

Day: December 4, 2026

Finding the Real tempdb Culprit

Aaron Bertrand is searching all of the golf courses:

In my previous post, I described a monitoring system that tries to get ahead of tempdb capacity problems instead of waiting for a full disk alarm to tell us something went wrong. It collects lightweight snapshots continuously, captures more detailed information when space starts getting tight, and can even disconnect particularly troublesome sessions when the right conditions are met.

That’s all useful for dealing with an incident while it’s happening. But one of the main reasons I built this system was to help with the inevitable question that comes afterward: What caused it?

We now have historical snapshots, session and request details, log transactions, growth events, and an audit trail of sessions nominated for termination (and the outcome of any attempts to terminate them). That’s a lot more information than I’d have trying to reconstruct an incident from DMVs after everyone has disconnected and gone home.

Unfortunately, having all this data doesn’t automatically make it easy to find the answer. 

Read on to learn what Aaron does to find an answer.

Leave a Comment

The Fibonacci Sequence and Factorials in T-SQL

Tomaz Kastrun has a new series running this month, and it’s all about mathematical operations in T-SQL. Day 1 kicks us off with the Fibonnaci sequence:

T-SQL is funny solving fibonacci sequence. It has been done so many times, that it is nothing new. Problems are two-fold. The bigint will be maxed out by 91st number and recursions must be controlled.

So in this case, I have put MAXRECURSION to a given number of 150, yet I am controlling the ā€œnā€ within the CTE.

Day 2 covers factorial numbers:

T-SQL is funny solving factorial numbers. As it exists in scripting and programming languages, there is still none available in T-SQL. The closes is a PRODUCT() function, but it is not factorial out-of-the-box. Similar to Fibonacci, Factorial also has similar problems The bigint will be maxed very fast, so using DECIMAL(38) will get you yo 34!

Click through for versions of the factorial query that work for SQL Server 2025 and for prior versions that did not have PRODUCT().

Leave a Comment

Microsoft Fabric OneLake Storage Tiering

Koen Verbeeck saves some money:

We are building a large data platform using Microsoft Fabric. We have a bunch of lakehouses where unstructured data – such as raw files, images, video, logs etc. – are stored, and the total storage already goes into the terabytes. Is there a way we can optimize our storage costs? For example, in Azure Blob Storage there are different storage tiers. Does OneLake have this option as well.

Read on for the answer, as well as some of the issues you might run into if you do change storage tiers for blob storage accounts in your workspace.

Leave a Comment