Press "Enter" to skip to content

Day: September 19, 2025

DBSCAN in SQL Server

Sebastiao Pereira is a mad lad and I love it:

Is it possible to have the DBSCAN algorithm in SQL Server without the use of external tools? If so, can you please provide a working example?

DBSCAN is a neat algorithm for clustering and it is reasonably popular in the literature. I cannot imagine that it would perform well at all in SQL Server on a large dataset, though in fairness, I did try out the Mail_Customers example Sebastiao noted. This dataset includes 196 rows after you eliminate four duplicate combinations of annual income and spending score, and the procedure returned in less than a second. Now, getting the execution plan for this took a while, but it was neat to see this working.

Leave a Comment

Tips for Technical Writing

Mike Robbins shares some guidance:

Passive voice hides the actor, making instructions vague or more difficult to follow. Instead, use active voice to clarify who performs the action. Active voice includes any sentence where the subject performs the action (e.g., You run the script).

  • Incorrect: When the font size is adjusted, the code becomes easier to read.
  • Correct: If you adjust the font size, your code becomes easier to read.

Active voice makes instructions direct and actionable.

I hate passive voice enough that I would link to this post even if it were the only piece of advice on there. There are very specific good uses for passive voice in English, particularly when you do not know who the actor was and the actor does not matter. The rest of the time, people primarily use passive voice when they want to weasel out of something or avoid assigning blame. And most of the time, even when you think this you have a good use case for passive voice, you probably don’t.

Case in point: “Archduke Franz Ferdinand’s assassination was a primary inciting factor for the Great War.” This is passive voice—we swapped a verb (assassinate) to a noun (assassination) in order to focus on the direct object at the expense of the subject. The general rule of thumb is that if you can ask “By whom?” when reading a sentence, there is a very good chance that the author used passive voice. And we may think at first that the actor does not matter, but I chose this example precisely because he does. In order to understand why the Austro-Hungarian government reacted the way it did, you have to know that the assassin was a Serbian nationalist, that the Russian government had a particularly close connection with Serbia, and that the Austro-Hungarian government had a very contentious relationship with the Balkans at that point (and I’m being kind by using the word “contentious” here). Granted, it’s not critical to fit all of this into the one sentence, but removing the subject turns into a game of “hide the ball” way too quickly.

In active tense, I’d rewrite the sentence to be something like: “A primary inciting factor for the Great War occurred when a Serbian nationalist assassinated Archduke Franz Ferdinand.”

Leave a Comment

SQL Firewall in Oracle

Brendan Tierney tries out the SQL Firewall feature in Oracle:

SQL Firewall allows you to implement a firewall within the database to control what commands are allowed to be run on the data. With SQL Firewall you can:

  • Monitor the SQL (and PL/SQL) activity to learn what the normal or typical SQL commands are being run on the data
  • Captures all commands and logs them
  • Manage a list of allowed commands, etc, using Policies
  • Block and log all commands that are not allowed. Some commands might be allowed to run

Read on to see how it works. It’s an interesting approach that can supplement traditional firewall and web application firewall systems.

Leave a Comment

Organizational Themes in Power BI

Boniface Muchendu takes a peek at a fairly new feature:

Keeping your Power BI reports consistent, clean, and on-brand just got a lot easier. With the new Organizational Themes feature released in June 2025, Power BI now allows organizations to centrally manage and distribute custom report themes across all users. No more manual theme imports or scattered design standards.

Read on to see how it works, and hopefully your organization does not have terrible standards.

Leave a Comment

Connecting to SQL Server when TempDB Transaction Log is Full

Garry Bargsley makes a connection:

Oh no.. my number one troubleshooting tool is not usable. Time to fire up a command prompt and connect via DAC, right?

Well, not so fast.

During a recent technical interview, I was introduced to a clever workaround that lets you connect to a distressed SQL Server using SSMS, even when it seems unresponsive.

Read on to see how you can connect without SSMS performing a bunch of background queries to retrieve data that end up using tempdb, and then resolve the issue.

Leave a Comment