T-SQL Tuesday #192 – SQL Server 2025 Excitement

Thank you to Steve Jones for repeat hosting T-SQL Tuesday this month again! This month we are talking about SQL Serve 2025, which I think we all expect to hit the shelves next week. Every new version of SQL Server, once I get access to the bits, I go to the What’s New page and start scanning. In past years since I was a Microsoft MVP, I knew most of what was coming down the pike, but even then it wasn’t always exactly assured that we knew exactly what to expect.

I generally skip all of the configuration/setup stuff and head to my favorite category: Language. I get really excited to see what is new, and this year is no exception.

For my T-SQL programmer loving side, this year there are several exciting new features, and the ones I am currently excited about are not even the ones about AI. This year I only had heard about what was announced in the PASS Keynotes and social media. Most of what I remembered from those were dark mode in SSMS, AI and Regular Expressions.

Since then, I have learned of a few others, but there are two areas where I am the most interested and RegEx is one of them.

RegEx

When I first heard that RegEx will be a part of SQL Server, I was still thinking “Regex what”? LIKE is all I need. (I also wasn’t an active SQL programmer at the time.) But once I got started with them, I was all in with RegEx because I didn’t realize just what all you can do with them. I wrote a blog series on them and finally learned about them. Turned out they are far more than a better version of LIKE. In fact, most of the functionality is centered on breaking up strings on complex delimiters in very interesting ways.

While they as complex as I always thought. They are far more useful than I ever imagined, but since the day I finished the blogs, I have needed them to parse many strings.

New ways to compare data

In my day job, I have been working on a large project to compare sets of data to other sets of data. A big part of this is comparing data that humans enter. And humans make mistakes. Lots of them. I mean, how many times have you typed your password or name incorrectly?

There are four items that interest me EDIT_DISTANCE, EDIT_DISTANCE_SIMILARITY, JARO_WINKLER_DISTANCE and JARO_WINKLER_SIMILARITY]. I haven’t really looked too deep into them yet, but one of these really caught my eye: EDIT_DISTANCE. It is defined as “Calculates the number of insertions, deletions, substitutions, and transpositions needed to transform one string to another.” This seems really great for looking for typos (certainly in concert with SOUNDEX or one of these other similarity tools (proper article on this forthcoming.).

For example, consider the following calls:

[code lang=”SQL”]

SET NOCOUNT ON
SELECT ‘Davidison’, ‘Davidson’, EDIT_DISTANCE(‘Davidison’, ‘Davidson’);
SELECT ‘Smythe’, ‘Smith’, EDIT_DISTANCE(‘Smythe’, ‘Smith’);
SELECT ‘Effj’, ‘Jeff’, EDIT_DISTANCE(‘Effj’, ‘Jeff’);
SELECT ‘Martha’, ‘Joe’, EDIT_DISTANCE(‘Martha’, ‘Joe’);
[/code]

First is a clear example of a type of typo:

[code light=”true”]


Davidison Davidson 1
[/code]

This next one you can see if you change y to i, and delete the h:

[code light=”true”]
—— —– ———–
Smythe Smith 2

[/code]

The next two examples, I don’t completely understand, but I think I have the general idea. It seems like you have to delete a J, add a j, and change the case of the e:

[code light=”true”]
—- —- ———–
Effj Jeff 3
[/code]

And finally Martha has 6 letters, so they would be overwritten.

[code light=”true”]
—— —- ———–
Martha Joe 6
[/code]

This will come in handy as the 1 and maybe 2 will certainly be interesting. I am assuming the EDIT_DISTANCE_SIMILARITY will be useful to differentiate between larger strings? Either way, pretty exciting stuff!

Summary

There are plenty of great new features in SQL Server 2025, including other language\engine improvements like JSON, AI vector changes, and plenty of other stuff. Certainly a lot more if you are deep into working as an administrator and need to configure the server for performance, security, and so much more.

One response to “T-SQL Tuesday #192 – SQL Server 2025 Excitement”

  1. […] Louis writes about regex. I was expecting more people to choose this, but glad Louis did. […]

Leave a Reply

I’m Louis

I have been at this database thing for a very long time, with no plans to stop.

Series: SQL Techniques You Should Know

Recents

Discover more from Drsql's Database Musings

Subscribe now to keep reading and get access to the full archive.

Continue reading