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 30 Mar 2020

By

I’ve started to add a daily coping tip to the SQLServerCentral newsletter, which is...

Error handling protip: @@Error resets after the next command

By

The system variable @@ERROR is a quick and easy way to retrieve the error...

Azure Analysis Services – Processing Hot & Cold Data using Tabular model partitions

By

Introduction Recently have been working on a “Proof of Concept” task where I wanted...

Read the latest Blogs

Forums

The Coping Thread

By Steve Jones - SSC Editor

I've started a series on my blog about coping strategies during the pandemic: https://voiceofthedba.com/tag/life/...

Get the difference from one record to the one previous

By Meridian9300

In it's simplest form I want a table that I can use to store...

Regarding for Microsoft Azure Certification

By Ankitdixit

Hello Everyone, I am new here and I am preparing for microsoft azure certification...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers