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.

(1)

You rated this post out of 5. Change rating

2025-05-27

263 reads

Blogs

Five Ways Redshift Serverless Quietly Eats Your Budget

By

It is Friday, the queries are running, and nobody is watching the bill. That...

A Career of Memories

By

Annabel retired from Redgate Software this week. Across most of my career at Redgate,...

Rethinking Index Maintenance: Why avg_fragmentation_in_percent Is Outdated and What You Should Do Instead

By

As a SQL Server DBA with years of experience tuning production environments, I’ve seen...

Read the latest Blogs

Forums

Alamat Kantor BCA KCP Bumiayu Telp:0817866887

By Layanan_24jam

WhatsApp:0817-866-887 Jl. Kalierang No.Ruko 3-5, Dukuhturi, Kec. Bumiayu, Kabupaten Brebes, Jawa Tengah 52273 (@bcakcpbumiayu)

BCA KCP Permata Ujung Menteng Tlp:0817839777

By R4nt4u

WhatsApp: 0817839777 Jl. Raya Bekasi Km. 25 Blok A/17, RW.18, Ujung Menteng, Wil, Kota...

Alamat Kantor BCA KCU RAWAMANGUN Tlp:0817839777

By layanan_Bca88

WhatsApp: 0817839777 Jl. Paus No.81, RT.1/RW.8, Wil, Kec. Pulo Gadung, Kota Jakarta Timur, Daerah...

Visit the forum

Question of the Day

BCP on Linux

When running bcp on Linux, what is the field terminator?

See possible answers