I have a need to create a function the will return nth element of a delimited string.
For a data migration project, I am converting JSON audit records stored in a S
You can use STRING_SPLIT with ROW_NUMBER:
SELECT value, idx FROM ( SELECT value, ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) idx FROM STRING_SPLIT('Lorem ipsum dolor sit amet.', ' ') ) t WHERE idx=2
returns second element (idx=2): 'ipsum'