Changes Coming To STRING_SPLIT: Optional Ordinal Position


In 2016, we got the STRING_SPLIT function. That was nice, because prior implementations had a lot of problems

But out of the gate, everyone looked at what we got and couldn’t figure why this would drop without a column to tell you the position of each element in the string.

Recently I updated SSMS to 18.10, and went to work on a couple scripts that use STRING_SPLIT.

I was immediately confronted by a bunch of RED SQUIGGLY LINES.


Not Yet But Soon



Insufficient! You’re insufficient!


Oh, enable_ordinal. Neat.


At least it’s a bigint.

get it

Thanks for reading!

2 thoughts on “Changes Coming To STRING_SPLIT: Optional Ordinal Position

  1. curious does this ever give the incorrect ord?

    select value, ord = row_number() over (order by (select null)) from string_split(‘1,2,3’, ‘,’)

Leave a Reply

Your email address will not be published. Required fields are marked *