STRING_SPLIT Has Ordinals
source link: https://voiceofthedba.com/2021/11/17/string_split-has-ordinals/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
STRING_SPLIT Has Ordinals
I noticed the docs for STRING_SPLIT now show that there is a third parameter. This brings us an ordinal for the positioning of the data. The format is now:
STRING_SPLIT( string, separator [, enable_ordinal])
This is a bit or int that determines if a positional value is added to the result set. Here’s a quick demo.
No third parameter shows this:
If I add a 1 for the third parameter, I see this:
Right now this is only in Azure. I assume we’ll see this in SQL Server 2022, but we’ll have to wait and see.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK