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)

2002-05-10

433 reads

Blogs

Daily Coping 21 Jan 2021

By

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

It’s 2021, so why are you reading this?

By

If you’re reading this, there’s a good chance you’re straight, white, male, and English-speaking....

Daily Coping 20 Jan 2021

By

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

Read the latest Blogs

Forums

A Beginning Project

By Steve Jones - SSC Editor

Comments posted to this topic are about the item A Beginning Project

Amend a Commit

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Amend a Commit

Save results from Stored procedure to a CSV file.

By lee.hopkins

I have a SqlAgentJob calling a stored proc. that loops through a list of...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Amend a Commit

See possible answers