Press "Enter" to skip to content

Day: September 18, 2025

Ingesting IoT Data into SQL Server via Python

Hristo Hristov builds an app:

MQTT is a lightweight Industrial IoT communications protocol allowing efficient communication to and from edge devices such as machines, sensors, and actuators. How can we get data from an MQTT on-premises or cloud broker and persist them in an SQL Server database? How can we leverage the newest features in SQL Server 2025 to make efficient query compilations and build a scalable solution for a data pipeline for permanently storing IoT data?

Read on for the code, most of which is in Python.

Leave a Comment

Finding Row Counts in Tables

Andy Brownsword wants a quick answer:

A question I ask myself often when exploring unfamiliar data sets. So here’s a quickie:

Click through for the script. This is a lot faster than SELECT COUNT(*), something that can really burn you when there are a few trillion rows in a table and your index scan interferes with ongoing operations. I’ve noticed that reading these counts from statistics is usually pretty solid, but generally, we’re interested in orders of magnitude, in which case 39,308,149 and 39,308,206 are close enough for purposes of understanding which tables are heftier.

Leave a Comment

The Readability Benefit of Splatting in Powershell

David Seis simplifies the code a bit:

Have you ever written a PowerShell command so long that it stretched across the screen? Or had to update a script and hunt through a long parameter list to change a single value? Splatting solves that problem by letting you pass multiple parameters to a command using a single variable.

Read on for some examples, including a good example of how to make similar cmdlet calls easier to read.

Leave a Comment

Responding to “The Server is Slow”

Kevin Hill shares some consulting advice:

Stop. Don’t Open SSMS Yet.

You’ve heard it before: “The server is slow.”

What does that actually mean?

If you jump straight into SQL Server looking for blocking, bad queries, or a missing index, you’re working with bad input. And bad input = wasted time.

The real work starts before you ever connect to SQL Server.

Click through for some guidance on how to frame the conversation. Even if you aren’t a consultant, I think it’s a good idea to scope and triage the problem in a similar fashion before trying to dive in and see what you can find.

Leave a Comment

Regular Expression Counts and Positions in SQL Server 2025

Louis Davidson wraps up a series on regular expressions:

I am only combining them into a short version because they are, in how they work, very similar to all the other functions. I certainly will demonstrate all the functionality for each function, but not to the extra level I have in previous blogs.

This time, I will cover:

  • REGEXP_INSTR Returns the starting or ending position of the matched substring, depending on the option supplied.
  • REGEXP_COUNT Returns a count of the number of times that regex pattern occurs in a string.

Read on to see how these work in SQL Server 2025.

Leave a Comment