Parse a delimited string, return n-th value

This UDF will parse a string delimited by the character you specify and return the value in the n-th position you requested.Example:select dbo.fn_parse('this string', ' ', 1) --> 'this'select dbo.fn_parse('this string', ' ', 2) --> 'string'select dbo.fn_parse('this string', ' ', 3) --> NULLselect dbo.fn_parse('this  string', ' ', 2) --> ''

1 (1)


436 reads


Career: Talk To References


As we try to get through these strange times in the world, I am...

This Saturday: #DataWeekender, DataSaturday Southwest


Geeked to be speaking 2x on Saturday May 14, my second time speaking at...

Daily Coping 14 May 2021


I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs


Query store index rebuilds

By Rasmus Remmer Bielidt

Recently we experienced a sudden surge in disk I/O every twenty minutes or so....

Group Managed Service Accounts for SQL Server 2017/2019

By @@caffeine_level

We use group managed service accounts for running the SQL Server 2017/2019 sqlserver.exe processes...

How to rewrite sql query after where condition with another query more arranged

By ahmed_elbarbary.2010

I work on sql server I need to rewrite statement after where statement so...

Visit the forum


SQL Server Q&A from the SQLServerCentral community

Get answers