I have a requirement to split a string based on a delimiter and to pull the values based on their ordinals. As I am on SQL Server 2019, I cannot use String_Split with ordinal enabled. Trying to replicate the same functionality using below STRING_SPLIT and Row_Number() query.
select *, row_number() over(order by (select null)) as seq from (SELECT * FROM STRING_SPLIT(CurrentPath, '/') where value <> '') t
My question is, when using select null along with order by clause and string_split, will the order of values be deterministic? I need to preserve the order in which values are returned by string_split function. Any pointers?