Extract values from a string using a delimiter

There are many occasions in programs where you need to manipulate strings of characters that are delimited by a particular character, such as a comma, or a space. This function enables you to extract a substring from the string at a specified occurence of the delimter. declare @Data varchar(255) set @Data = 'A,B,C,D,E' print dbo.field(@data,',',2,2) […]

4.17 (6)

2011-11-07 (first published: )

2,457 reads

Blogs

Goal Progress for July 2021

By

I set goals at the beginning of the year, and I’m tracking my progress...

Data Modeling at your fingertips

By

(2021-July-30) A picture is worth a thousand words, the same way a visual database schema...

How to put a SQL Server Database into Recovery Pending

By

You might be asking why on earth would you want to get a database...

Read the latest Blogs

Forums

How is Throughput optimized HDD (st 1)

By kratosrules99

Hi Everyone. i am planning to shift my website to AWS   I want...

Alternative to LAG(SUM) - Can a Column Reference The Sum of the Values Above It

By John O'Connor

Hi Everyone, I'm trying to do something that seems pretty simple, but SQL Server...

Transaction log shrink w/ logshipping

By mavelzen

Hello everyone, Again with this question. 🙂 I've got a log-shipped database, and I...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers