Technical Article

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)

You rated this post out of 5. Change rating


474 reads


Executing One Line in VSCode–#SQLNewBlogger


I wrote about arrays in PowerShell last week, but I realized one of the...

Friday Flyway Tips–Comparison Options


Recently a customer asked how they could get index changes to be captured in...

A New Word: Guiltwrights


giltwrights  – n. the imaginary committee of elders that keeps a running log of...

Read the latest Blogs


Selecting from a view, base table has a DENY on a column

By pveilleux

This is something I've never seen before and I can't think of the right...

JSON data with Pivoted

By Tava

Hi All, I need some assistance and not sure how to achieve the expected...

SQL Window Functions Series: LAG() and LEAD()

By Nikhil Bangad

Comments posted to this topic are about the item SQL Window Functions Series: LAG()...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers