Scripts

Technical Article

T-SQL Table Valued Function to compare Semantic Versions

Semantic versioning (SemVer) is a standardized system for labeling software releases using a three-part number—major, minor, and patch—optionally followed by pre-release labels and build metadata. Comparing semantic versions is complex because it requires handling both numeric and string components, as well as special precedence rules for pre-releases and stable versions. SQL Server’s hierarchyid data type is ideally suited for comparing the numeric parts of semantic versions, enabling efficient and accurate ordering without the pitfalls of string comparison or manual parsing.

5 (1)

You rated this post out of 5. Change rating

2025-05-27

91 reads

Blogs

Speaking Engagements 2025

By

It’s been a minute since I’ve gotten out to speak at events, but the...

PASS Summit on Tour in New York City

By

The PASS Summit goes on tour this year, with an August stop in New...

SQL Server Errorlog: Not Just for Errors!

By

A Goldmine of Clues You Might Be Ignoring SQL Server’s Error Logs often get...

Read the latest Blogs

Forums

Need Help to implement the De Duplication

By bala2014

Dear All, Good Day. I have a requirement to implement de-duplication on customer data...

Own Your Mistakes

By Grant Fritchey

Comments posted to this topic are about the item Own Your Mistakes

Automating SQL Server Inventory Collection with SQLInventory

By Deepam Ghosh

Comments posted to this topic are about the item Automating SQL Server Inventory Collection...

Visit the forum

Question of the Day

Independence Day

The film independence day was released in 1996. Which of these queries returns that year is run today?

See possible answers