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,454 reads

Blogs

Daily Coping 1 Oct 2020

By

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

PASS Virtual Summit 2020 Conference Sessions

By

Whether you are a SQL Server Database Administrator or Infrastructure Architect, you should be...

Running Express Edition in a Container–#SQLNewBlogger

By

Another post for me that is simple and hopefully serves as an example for...

Read the latest Blogs

Forums

Internal Query Processor Error: The query processor could not produce a query pl

By YSLGuru

Is there a standard method for troubleshooting the below error? Internal Query Processor Error:...

How to extract string between variable characters?

By C-M-A

Hi All, I've got a nasty column that I need to get the name...

Making 1 row from 2

By SQLHeap

I'm struggling a bit here. It seems easy, but I 'm not getting it....

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers