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

203 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-25 (first published: )

777 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,062 reads

Blogs

T-SQL Tuesday #193 - Notes to Self

By

T-SQL Tuesday is a monthly blog party hosted by a different community member each...

T-SQL Tuesday #193 – Notes to my past self and from my future self

By

It has been a while since my last T-SQL Tuesday blog. When I saw...

T-SQL Tuesday #193 – Notes to past and future me

By

The last T-SQL Tuesday of the year is hosted by my good friend Mike...

Read the latest Blogs

Forums

Struggling With Deadlines? Can an Assignment Helper Really Improve Your Grades?

By zackjones639721

Many students today feel overwhelmed by tight submission dates, back-to-back classes, and complicated academic...

MAX_DISPATCH_LATENCY in extended event , is not clearly explained in msdn.

By rajemessage 14195

hi,   i have checked reducing it increasing it but could not get any...

What is the PRODUCT

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is the PRODUCT

Visit the forum

Question of the Day

What is the PRODUCT

In SQL Server 2025, what does this return?

CREATE TABLE Numbers
( n INT)
GO
INSERT dbo.Numbers
(
n
)
VALUES
(1), (2), (3)
GO
SELECT PRODUCT(n)
FROM dbo.Numbers

See possible answers