{"id":29172,"date":"2023-10-30T06:16:00","date_gmt":"2023-10-30T05:16:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=29172"},"modified":"2023-11-15T10:25:10","modified_gmt":"2023-11-15T09:25:10","slug":"split-text-into-columns-sql-server","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/","title":{"rendered":"Split delimited text into columns in SQL Server"},"content":{"rendered":"\n<p>This tutorial is about how to split a delimited text into multiple independent columns with SQL Server. Working with comma or semi-colon delimited data often requires efficient and effective manipulation techniques. A common task is to split a single text variable into multiple columns.<\/p>\n\n\n\n<p>This is particularly useful for preparing CSV file imports or restructuring data. In this article, we&#8217;ll explore a straightforward method to achieve this using T-SQL. Indeed, in the previous tutorial about splitting strings, we discussed how to <strong><a href=\"https:\/\/expert-only.com\/en\/t-sql\/split-string-with-delimiter-in-sql-server\/\">split a delimited text stored in a variable into one single column<\/a><\/strong>, one value per column. <\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#sql-server-script-to-split-delimited-text-into-multiple-columns\" >SQL Server script to split delimited text into multiple columns<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#explanation-of-the-sql-server-code-to-split-a-delimited-string\" >Explanation of the SQL Server code to split a delimited string<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#a-convenient-pure-t-sql-solution-to-split-a-string-into-columns\" >A convenient pure T-SQL solution to split a string into columns<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-sql-server-script-to-split-delimited-text-into-multiple-columns\"><span class=\"ez-toc-section\" id=\"sql-server-script-to-split-delimited-text-into-multiple-columns\"><\/span><strong>SQL Server script to split delimited text into multiple columns<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So this script allows you to split a string composed of semi-columns separated data into multiple hard coded columns.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">-- Declare the variables\nDECLARE\n   @String nvarchar(max),\n   @Delimiter char(1);\n\n-- Initialize the string and the delimiter\nSELECT @String = 'New York;Los Angeles;Chicago;Houston;Phoenix;Philadelphia;San Antonio;San Diego;Dallas;San Jose',\n       @Delimiter = ';'\n;\n\n-- Split the string into multiple columns\nWITH cte AS (\n    SELECT value, ROW_NUMBER() OVER(ORDER BY (SELECT 1)) as id\n    FROM STRING_SPLIT(@String, @Delimiter)\n)\n\nSELECT\n    MAX(CASE WHEN id = 1 THEN value END) AS column_1,\n    MAX(CASE WHEN id = 2 THEN value END) AS column_2,\n    MAX(CASE WHEN id = 3 THEN value END) AS column_3,\n    MAX(CASE WHEN id = 4 THEN value END) AS column_4,\n    MAX(CASE WHEN id = 5 THEN value END) AS column_5,\n    MAX(CASE WHEN id = 6 THEN value END) AS column_6,\n    MAX(CASE WHEN id = 7 THEN value END) AS column_7,\n    MAX(CASE WHEN id = 8 THEN value END) AS column_8,\n    MAX(CASE WHEN id = 9 THEN value END) AS column_9,\n    MAX(CASE WHEN id = 10 THEN value END) AS column_10\nFROM cte;\n<\/pre>\n\n\n\n<p>The provided query demonstrates how to split a semicolon-separated string into individual columns. The steps are as follows:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-explanation-of-the-sql-server-code-to-split-a-delimited-string\"><span class=\"ez-toc-section\" id=\"explanation-of-the-sql-server-code-to-split-a-delimited-string\"><\/span><strong>Explanation of the SQL Server code to split a delimited string<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This section explains step by step the code above to better understand the concepts. The code simply split the semicolon delimited text into distinct columns using SQL Server code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-1-declare-the-variables\">Step 1: Declare the variables<\/h3>\n\n\n\n<p>We start by declaring two variables: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>@String<\/code> for the text to be split<\/li>\n\n\n\n<li><code>@Delimiter<\/code> for the separator character<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DECLARE\n   @String nvarchar(max),\n   @Delimiter char(1);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-2-initialize-the-variables\">Step 2: Initialize the variables<\/h3>\n\n\n\n<p>Initialize <code>@String<\/code> with the values separated by semicolons and set <code>@Delimiter<\/code> to the semicolon character.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT @String = 'New York;Los Angeles;Chicago;Houston;Phoenix;Philadelphia;San Antonio;San Diego;Dallas;San Jose', @Delimiter = ';'<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-3-split-the-string\">Step 3: Split the string<\/h3>\n\n\n\n<p>The <code>STRING_SPLIT<\/code> function is used within a Common Table Expression (CTE) to split the string. <code>ROW_NUMBER<\/code> assigns a unique sequential integer to each split value.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">WITH cte AS (\n    SELECT value, ROW_NUMBER() OVER(ORDER BY (SELECT 1)) as id\n    FROM STRING_SPLIT(@String, @Delimiter)\n)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-step-4-select-the-columns\">Step 4: Select the columns<\/h3>\n\n\n\n<p>Finally, we use a <code>SELECT<\/code> statement with multiple <code>MAX(CASE...)<\/code> clauses to pivot these values into separate columns.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT\n    MAX(CASE WHEN id = 1 THEN value END) AS column_1,\n    MAX(CASE WHEN id = 2 THEN value END) AS column_2,\n    MAX(CASE WHEN id = 3 THEN value END) AS column_3,\n    MAX(CASE WHEN id = 4 THEN value END) AS column_4,\n    MAX(CASE WHEN id = 5 THEN value END) AS column_5,\n    MAX(CASE WHEN id = 6 THEN value END) AS column_6,\n    MAX(CASE WHEN id = 7 THEN value END) AS column_7,\n    MAX(CASE WHEN id = 8 THEN value END) AS column_8,\n    MAX(CASE WHEN id = 9 THEN value END) AS column_9,\n    MAX(CASE WHEN id = 10 THEN value END) AS column_10\nFROM cte;\n<\/pre>\n\n\n\n<p>As we could see, the code is relatively static and adaptable, but achieves a different purpose than the <a href=\"https:\/\/www.databasestar.com\/sql-split-string\/#SQL_Server\">STRING_SPLIT<\/a> built in function. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-a-convenient-pure-t-sql-solution-to-split-a-string-into-columns\"><span class=\"ez-toc-section\" id=\"a-convenient-pure-t-sql-solution-to-split-a-string-into-columns\"><\/span><strong>A convenient pure T-SQL solution to split a string into columns<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This query is a simple yet effective way to split a delimited text into multiples columns in SQL Server. It&#8217;s suitable for scenarios where the number of columns is predetermined and does not exceed ten. Of course it is very easily extendable. But it is a static solution.<\/p>\n\n\n\n<p>For more complex cases, such as a variable number of columns, dynamic SQL can be employed. This method is a handy tool for database developers  looking to streamline their data import and manipulation processes in SQL Server.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/expert-only.com\/en\/t-sql\/split-string-with-delimiter-in-sql-server\/\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>This tutorial is about how to split a delimited text into multiple independent columns with SQL Server. Working with comma or semi-colon delimited data often requires efficient and effective manipulation techniques. A common task is to split a single <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\" title=\"Split delimited text into columns in SQL Server\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":10452,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-29172","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Split delimited text into columns in SQL Server - T-SQL<\/title>\n<meta name=\"description\" content=\"T-SQL query example to split a text that contains semicolons delimited values into multiple independents columns with SQL Server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Split delimited text into columns in SQL Server\" \/>\n<meta property=\"og:description\" content=\"T-SQL query example to split a text that contains semicolons delimited values into multiple independents columns with SQL Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-30T05:16:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-15T09:25:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"Split delimited text into columns in SQL Server\",\"datePublished\":\"2023-10-30T05:16:00+00:00\",\"dateModified\":\"2023-11-15T09:25:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\"},\"wordCount\":402,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\",\"name\":\"Split delimited text into columns in SQL Server - T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg\",\"datePublished\":\"2023-10-30T05:16:00+00:00\",\"dateModified\":\"2023-11-15T09:25:10+00:00\",\"description\":\"T-SQL query example to split a text that contains semicolons delimited values into multiple independents columns with SQL Server.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Split delimited text into columns in SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Split delimited text into columns in SQL Server - T-SQL","description":"T-SQL query example to split a text that contains semicolons delimited values into multiple independents columns with SQL Server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"Split delimited text into columns in SQL Server","og_description":"T-SQL query example to split a text that contains semicolons delimited values into multiple independents columns with SQL Server.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2023-10-30T05:16:00+00:00","article_modified_time":"2023-11-15T09:25:10+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"Split delimited text into columns in SQL Server","datePublished":"2023-10-30T05:16:00+00:00","dateModified":"2023-11-15T09:25:10+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/"},"wordCount":402,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/","url":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/","name":"Split delimited text into columns in SQL Server - T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg","datePublished":"2023-10-30T05:16:00+00:00","dateModified":"2023-11-15T09:25:10+00:00","description":"T-SQL query example to split a text that contains semicolons delimited values into multiple independents columns with SQL Server.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/city-buildings-river-skyscrapper-BF7A3BA1DAA_1920x1080.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/split-text-into-columns-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"Split delimited text into columns in SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/29172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=29172"}],"version-history":[{"count":9,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/29172\/revisions"}],"predecessor-version":[{"id":29181,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/29172\/revisions\/29181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/10452"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=29172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=29172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=29172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}