Steve Collins


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

287 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

You rated this post out of 5. Change rating

2019-11-24

850 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

You rated this post out of 5. Change rating

2019-11-12 (first published: )

2,108 reads

Blogs

Take Time to Gain Perspective

By

Probably the best piece of advice I ever received is to take time to...

The Fringe Festival

By

I was lucky enough to take a vacation a decade ago in Edinburgh with...

Demo for Parameter Sniffing and Memory Grant Feedback

By

Disclaimer: The following is built with Claude Code. Just need to justify my $100/mo...

Read the latest Blogs

Forums

Alamat Kantor BCA KCU BOGOR Tlp:08217555651

By layanan_Bca88

WA CS 628217555651 Jl. Ir. H. Juanda No.28, RT.03/RW.02, Paledang, Kecamatan Bogor Tengah, Kota...

Alamat Kantor BCA KCU Sukabumi Tlp:08217555651

By m4rt1n4

WA CS 628217555651 Jl. A. Yani No.33-35, Gunungparang, Kec. Cikole, Kota Sukabumi, Jawa Barat...

Alamat Kantor BCA KCU Karawang Tlp:08217555651

By R4nt4u

WA CS 628217555651 Jl. Interchange Karawang Barat, Purwadana, Karawang, 41361, Purwadana, Telukjambe Timur, Karawang,...

Visit the forum

Question of the Day

The SQL Server MCP Server

How do I get an MCP server for my SQL Server 2025 database from Microsoft?

See possible answers