---
title: Converting Delimited Values into Rows
description: Learn how to convert delimited values into rows using a table-valued udf in SQL Server. Transform your data for easier analysis and optimization. Explore the solution now!
image: https://booking.datalabsolutions.ai/hubfs/converting-delimited-values-rows.jpg
---

[Skip to content](https://booking.datalabsolutions.ai/blog/converting-delimited-values-into-rows#main-content)

[![Wordmark_Dark_500px](https://booking.datalabsolutions.ai/hs-fs/hubfs/Wordmark_Dark_500px.png?width=148&height=40&name=Wordmark_Dark_500px.png "Wordmark_Dark_500px")](http://www.datalabsolutions.ai)

- [About](https://booking.datalabsolutions.ai/about)
- [Services](https://booking.datalabsolutions.ai/services)
- [Resources](https://booking.datalabsolutions.ai/blog)
- [Technology Partners](https://booking.datalabsolutions.ai/technology-partners)
- [Contact Us](https://booking.datalabsolutions.ai/contact)

- [About](https://booking.datalabsolutions.ai/about)
- [Services](https://booking.datalabsolutions.ai/services)
- [Resources](https://booking.datalabsolutions.ai/blog)
- [Technology Partners](https://booking.datalabsolutions.ai/technology-partners)
- [Contact Us](https://booking.datalabsolutions.ai/contact)

[Contact Us](https://booking.datalabsolutions.ai/contact)

[Guides](https://booking.datalabsolutions.ai/blog/tag/guides)

# Converting Delimited Values into Rows

 Datalab

![](https://booking.datalabsolutions.ai/hubfs/converting-delimited-values-rows.jpg)

#### Delimited Values into Rows 

We have seen a lot of posts recently asking, how can I search within a field of delimited values or join to a list of delimited values. The truth is its very difficult. The best approach is to turn that list of values from a rows into a columns.

In this post we are going to show you a table valued udf that will do this transformation from delimted list, to rows.

#### The Solution

First, lets create a sample table.

 

 

You should have results that look like this. 

![459454_919531](https://booking.datalabsolutions.ai/hs-fs/hubfs/459454_919531.webp?width=263&height=410&name=459454_919531.webp)

 

Now lets create the UDF that will transform the delimited column into rows. The UDF uses the XML and XQuery functionality of SQL Server to transpose the delimited columns into XML nodes then convert those nodes back into rows.

 

 

Now lets see the UDF in action.

 

Your result set now should look something like this: 

![376202_169100](https://booking.datalabsolutions.ai/hs-fs/hubfs/376202_169100.webp?width=440&height=436&name=376202_169100.webp)

 

#### Downloads

Download Source Files: Here

[![Share on Facebook](https://static.hubspot.com/final/img/common/icons/social/facebook-24x24.png)](http://www.facebook.com/share.php?u=https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Dfacebook) [![Share on LinkedIn](https://static.hubspot.com/final/img/common/icons/social/linkedin-24x24.png)](http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Dlinkedin) [![Share on Twitter](https://static.hubspot.com/final/img/common/icons/social/twitter-24x24.png)](https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&url=https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&source=tweetbutton&text=Converting%20Delimited%20Values%20into%20Rows) [![Share on Pinterest](https://static.hubspot.com/final/img/common/icons/social/pinterest-24x24.png)](http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Dpinterest&media=http%3A%2F%2Fcdn1.hubspot.com%2Fhub%2F158015%2F305390_10100548508246879_837195_59275782_6882128_n.jpg) [![Share on Email](https://static.hubspot.com/final/img/common/icons/social/email-24x24.png)](mailto:?subject=Check%20out%20https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Demail%20&body=Check%20out%20https%3A%2F%2Fbooking.datalabsolutions.ai%2Fblog%2Fconverting-delimited-values-into-rows%3Futm_medium%3Dsocial%26utm_source%3Demail)

![](https://booking.datalabsolutions.ai/hubfs/4.%20LinkedIn-Logo-286px-1.1.png)

# Datalab

[info@datalab.co.uk](mailto:info@datalab.co.uk)

#### We are a data analytics and business intelligence cosnultancy operating from Cape Town. We offer consulting and data solution implementation services ranging from small scale to enterprise grade

<https://datalabsolutions.co.uk> <https://linkedin.com/company/datalabsolutions>

## Related resources

[![Datanomics: Maximizing Returns from Your Data](https://booking.datalabsolutions.ai/hs-fs/hubfs/close%20up%20of%20businessman%20hand%20working%20on%20laptop%20computer%20with%20financial%20business%20graph%20information%20diagram%20on%20wooden%20desk%20as%20concept.jpeg?width=352&name=close%20up%20of%20businessman%20hand%20working%20on%20laptop%20computer%20with%20financial%20business%20graph%20information%20diagram%20on%20wooden%20desk%20as%20concept.jpeg)](https://booking.datalabsolutions.ai/blog/datanomics-maximizing-returns-from-your-data)

### [Datanomics: Maximizing Returns from Your Data](https://booking.datalabsolutions.ai/blog/datanomics-maximizing-returns-from-your-data)

[![](https://booking.datalabsolutions.ai/hs-fs/hubfs/sql-multiply.jpg?width=352&name=sql-multiply.jpg)](https://booking.datalabsolutions.ai/blog/sql-row-constructors)

### [SQL Row Constructors](https://booking.datalabsolutions.ai/blog/sql-row-constructors)

[![](https://booking.datalabsolutions.ai/hs-fs/hubfs/dynamic-pyvot.jpg?width=352&name=dynamic-pyvot.jpg)](https://booking.datalabsolutions.ai/blog/dynamic-pivot-sql)

### [Dynamic Pivot SQL](https://booking.datalabsolutions.ai/blog/dynamic-pivot-sql)

![Coworkers sitting together and smiling outside.](https://booking.datalabsolutions.ai/hs-fs/hubfs/raw_assets/public/datalab/images/datalab-logo-white.png?width=149&height=40&name=datalab-logo-white.png "Coworkers sitting together and smiling outside.")

We know the data challenges your organisation face, and have the team and expertise to help.

[Follow us on Facebook](https://www.facebook.com) [Follow us on LinkedIn](https://www.linkedin.com) [Follow us on Twitter](https://www.twitter.com) [Follow us on Instagram](https://www.instagram.com)

##### Company

- [About](https://booking.datalabsolutions.ai/about)
- [Services](https://booking.datalabsolutions.ai/services)
- [Resources](https://booking.datalabsolutions.ai/blog)
- [Technology Partners](https://booking.datalabsolutions.ai/technology-partners)
- [Contact Us](https://booking.datalabsolutions.ai/contact)

- [About](https://booking.datalabsolutions.ai/about)
- [Services](https://booking.datalabsolutions.ai/services)
- [Resources](https://booking.datalabsolutions.ai/blog)
- [Technology Partners](https://booking.datalabsolutions.ai/technology-partners)
- [Contact Us](https://booking.datalabsolutions.ai/contact)

##### Services

- [Data Strategy](https://booking.datalabsolutions.ai/services#datastrategy)
- [Cloud Architecture](https://booking.datalabsolutions.ai/services#cloudarchitecture)
- [Data Integration](https://booking.datalabsolutions.ai/services#dataintegration)
- [Data Visualisation](https://booking.datalabsolutions.ai/services#datavisualisation)
- [Embedded Analytics](https://booking.datalabsolutions.ai/services#datamonetisation)
- [Capability Development](https://booking.datalabsolutions.ai/services#capabilitydevelopment)

- [Data Strategy](https://booking.datalabsolutions.ai/services#datastrategy)
- [Cloud Architecture](https://booking.datalabsolutions.ai/services#cloudarchitecture)
- [Data Integration](https://booking.datalabsolutions.ai/services#dataintegration)
- [Data Visualisation](https://booking.datalabsolutions.ai/services#datavisualisation)
- [Embedded Analytics](https://booking.datalabsolutions.ai/services#datamonetisation)
- [Capability Development](https://booking.datalabsolutions.ai/services#capabilitydevelopment)

##### Join Our Newsletter

Copyright © 2026 Datalab 2023 All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Datalab",
    "url" : "https://booking.datalabsolutions.ai/blog/author/datalab"
  },
  "dateModified" : "2024-04-26T09:45:50.791Z",
  "datePublished" : "2024-04-26T09:36:10.000Z",
  "headline" : "Converting Delimited Values into Rows",
  "image" : [ "https://booking.datalabsolutions.ai/hubfs/converting-delimited-values-rows.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://booking.datalabsolutions.ai/blog/converting-delimited-values-into-rows",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://booking.datalabsolutions.ai/hubfs/Wordmark_Dark_500px_no_bg.png"
    },
    "name" : "datalab"
  }
}
```