Press "Enter" to skip to content

Curated SQL Posts

Troubleshooting with Extended Events

Grant Fritchey knows one way to solve the problem:

A client asked us to tell them when a query ran long. Simple. We have a long running query alert, all built in to Redgate Monitor, so, done. No, see, we like getting alerted when queries run long, but not really long, plus we’re more concerned with just one database.

Click through for the story and how Grant was able to help out the client. Also, read the comments for an entry by Special Guest Star Erik Darling.

Comments closed

Troubleshooting Weird Issues

Chad Callihan says sometimes, the best answer is not to play the game:

After some database infrastructure changes related to phasing out the use of linked servers, I encountered issues with a setup tool used to build out new databases and other related features. One section of the tool was failing, and the errors indicated that there were still stored procedures utilizing linked servers, which was causing the problem. I asked myself a few questions on how best to proceed. Does the setup tool need to be updated? Do the related database procedures using linked servers need to be updated? Do the linked server changes made need to be rolled back altogether?

Read on for a proper Gordian Knot solution.

Comments closed

Resource Governor on TempDB in SQL Server 2025

Ed Pollack takes a peak at some upcoming functionality:

TempDB is a system database in SQL Server that manages temporary objects for all databases on a server. Because it is a shared resource, it can easily become a performance bottleneck., as well as an opportunity for a single database or even a single query to wreck SQL Server performance.

Because of this, administrators will often give TempDB plenty of space and put its files on the fastest storage available. Even with these precautions, it is still possible for a TempDB-hungry workload to hog space and resources that result in latency or timeouts for end users.

SQL Server 2025 introduces the ability to use Resource Governor to help manage TempDB resources automatically. This article dives into the new feature, how to configure it, and how it can effectively manage TempDB-heavy workloads.

Ed starts with a primer on TempDB and Resource Governor functionality, then dives right in. It’s good to see some love for Resource Governor.

Comments closed

SQL Server Performance Troubleshooting Script Updates

Erik Darling has been busy (plus raking in changes from contributors like he’s farming in an AFK game):

It’s been a busy few months working on scripts in my GitHub repo, including adding two new members to the family.

  • sp_IndexCleanup: Easily deduplicate indexes — scripts all the changes out for you!
  • sp_PerfCheck: A high-level review of performance-related settings and configurations!

Read on to see which other scripts have updates and where you can download all of Erik’s scripts.

Comments closed

Debugging Fabric UDFs in Visual Studio Code

Sunitha Muthukrishna takes us through a debugging exercise:

Debugging your code is important to identify issues and mitigate them when you’re working with user data functions in Microsoft Fabric. You want to make sure everything works as it should and that’s where local debugging lets you catch problems in your code without messing with the live environment. In this blog post, I will walk you through the steps to make local debugging easier and faster.

Click through to see what you’ll need, as well as the process to debug a function locally.

Comments closed

Databases and Reboots

Rob Douglas will reboot many things, but not the database server:

I am taking a slightly different tangent. My problem is neither strange or unique – in fact it’s infuriatingly common and it stems from one of the most common troubleshooting techniques in IT. While asking users “Have you tried turning it off and on again?” is a common go to for tech support call handlers, it is not a great idea when the “it” you are talking about is a database server

Click through for a cautionary tale, as well as an explanation of why this usually isn’t the smart play.

Comments closed

SSMS 21 Extended Events Session Creation Bugfix

Grant Fritchey is happy:

I have a proper blog post coming out tomorrow for T-SQL Tuesday, but today, celebrate with me that SSMS 21 finally, at long last, fixes the irritating fact that the New Session window in SSMS for Extended Events always opened to the wrong size.

Click through for an example of the bug and how SSMS 21 fixes things. This type of bug is particularly pernicious because there aren’t scroll bars or any sort of indicator that some additional functionality exists, so unless you know that it’s there, you won’t know to look for it.

Comments closed

Advanced Imputation Techniques via scikit-learn

Ivan Palomares Carrascosa isn’t just using the median:

Missing values appear more often than not in many real-world datasets. There can be instances with missing values in one or several of their attributes for various reasons, such as human error, corrupted data, or incomplete data collection processes, e.g. from surveys with optional fields. While there exist basic strategies to deal with instances or attributes containing missing values, — like removing rows or columns entirely, or imputing missing values with a default value (typically the mean or median of the attribute) — these strategies are sometimes not sufficient.

This article presents some advanced strategies to handle missing data, namely, imputation techniques made possible through a combined use of Pandas and Scikit-learn libraries in Python.

Click through for three such techniques, including an example of how to use the technique and under which circumstances to avoid that technique.

Comments closed

Sockets vs Cores and SQL Server

Vlad Drumea checks server settings:

It’s not uncommon that I run into a VM that’s configured with something like 6 or more cores with each core on one socket.

Here’s an example how this would show up in Task Manager for a VM with 16 CPU cores configured with 1 core per socket.

Read on to learn why this particular configuration can turn out so poorly with SQL Server, particularly when you use Standard Edition.

Comments closed