{"id":18925,"date":"2022-11-10T06:44:00","date_gmt":"2022-11-10T05:44:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=18925"},"modified":"2022-12-01T08:43:35","modified_gmt":"2022-12-01T07:43:35","slug":"store-a-sql-server-column-in-a-variable","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/","title":{"rendered":"Store a SQL Server column in a variable with delimiters"},"content":{"rendered":"\n<h4 class=\"has-text-align-center wp-block-heading\" id=\"h-query-to-store-the-contents-of-a-sql-server-column-in-a-variable-inline-and-with-delimiters\"><strong><em>Query to store the contents of a SQL Server column in a variable, inline and with delimiters.<\/em><\/strong><\/h4>\n\n\n\n<p>SQL tutorial to read and store the result from a SQL Server column in a variable, and with separators. In some cases, it is useful to get all the values of a column in a T-SQL variable and add a delimiter.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to store the contents of a SQL Server column in a variable?<\/h2>\n\n\n\n<p>To prepare a table with specific characteristics for example. For example, how to transform the standard display of a SQL Server column, like this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Column<\/strong><\/li>\n\n\n\n<li>Result-1<\/li>\n\n\n\n<li>Result-2<\/li>\n\n\n\n<li>Result-3<\/li>\n\n\n\n<li>Result-4<\/li>\n<\/ul>\n\n\n\n<p>And display this, i.e., the result of all selected rows in a variable with a comma or semi-colon separator for example:<\/p>\n\n\n\n<p><strong>Variable<\/strong>: Result-1, Result-2, Result-3, Result-4<\/p>\n\n\n\n<p>To follow the flow, create the table used in the example, insert rows into it and build the query to suit the specific needs. For the full example, follow the steps below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Create the customer table and insert some rows<\/h2>\n\n\n\n<p>Start by creating the customers table as an example and selecting the country column.<\/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=\"\">-- Create the customers table\nCREATE TABLE [dbo].[Customers](\n   [CustomerID] [int] NOT NULL,\n   [FirstName] [nvarchar](20) NULL,\n   [LastName] [nvarchar](20) NULL,\n   [City] [nvarchar](20) NULL,\n   [Country] [nvarchar](50) NULL,\n   CONSTRAINT [CustomersPrimaryKeyCustomerID] \n      PRIMARY KEY CLUSTERED ([CustomerID] ASC)\n);\nGO\n-- Insert 4 different lines\nINSERT INTO dbo.Customers (CustomerID, FirstName, LastName, City, Country) \nVALUES ( 1, 'Ali','Ahmed','Cairo','Egypt');\nINSERT INTO dbo.Customers (CustomerID, FirstName, LastName, City, Country) \nVALUES ( 2, 'Johnny','John','Toronto','Canada');\nINSERT INTO dbo.Customers (CustomerID, FirstName, LastName, City, Country) \nVALUES ( 3, 'John','Doe','Mexico City','Mexico');\nINSERT INTO dbo.Customers (CustomerID, FirstName, LastName, City, Country) \nVALUES ( 4, 'Shu','Abbas','Paris','France');\n\nSELECT [Country] \nFROM [dbo].[Customers];\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"700\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-create-customers-table-and-select-country-column.jpg\" alt=\"Create the customer table before displaying the country column in line with delimiters\" class=\"wp-image-11722\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-create-customers-table-and-select-country-column.jpg 800w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-create-customers-table-and-select-country-column-300x263.jpg 300w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-create-customers-table-and-select-country-column-768x672.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\"><strong>Create the customer table before displaying the country column in line with delimiters<\/strong><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. Query to store a column in a row with delimiters<\/h2>\n\n\n\n<p>The following query allows you to store each row of the column in a variable and to add a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Delimiter\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">separator or delimiter<\/a>, in this case the semicolon. And the result is a single row. The script uses the SQL Server <a href=\"https:\/\/linuxhint.com\/sql-server-coalesce\/\" target=\"_blank\" rel=\"noreferrer noopener\">function<\/a> COALESCE.<\/p>\n\n\n\n<p>The variable can contain 1000 characters, depending on the need, the type of the text variable must be adapted. In particular to <a href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-text-with-more-than-8000-characters\/\">manage strings of more than 8000 characters with a T-SQL variable<\/a>.<\/p>\n\n\n\n<p>The query is built this way:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select original data in column<\/li>\n\n\n\n<li>Declare the variable used to iterate<\/li>\n\n\n\n<li>Select the data and store it inside the variable using the coalesce function<\/li>\n\n\n\n<li>Finally display the variable content using a simple select<\/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=\"\">-- Classical selection\nSELECT [Country] \nFROM   [dbo].[Customers];\n\n-- Transform column in one line\nDECLARE @result_in_line nvarchar(1000);\n\nSELECT    @result_in_line = COALESCE(@result_in_line+';','') + [Country]\nFROM    [dbo].[Customers];\n\nSELECT    @result_in_line;<\/pre>\n\n\n\n<p>Here is the result of the script run from an SSMS Window:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"520\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-t-sql-coalesce-query-turn-column-in-one-line.jpg\" alt=\"How to store an SQL column in a variable with delimiters?\" class=\"wp-image-11727\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-t-sql-coalesce-query-turn-column-in-one-line.jpg 800w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-t-sql-coalesce-query-turn-column-in-one-line-300x195.jpg 300w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssms-t-sql-coalesce-query-turn-column-in-one-line-768x499.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\"><strong>How to store an SQL column in a variable with delimiters?<\/strong><\/figcaption><\/figure>\n\n\n\n<p>Here is how to store a SQL Server column in a variable, in line with semicolon separators, rather than in a column. Indeed, this example script written in T-SQL is particularly useful for displaying separate values of a column, sorted in ascending order.<\/p>\n\n\n\n<p>Finally, to learn some new T-SQL scripts, here is a <a href=\"https:\/\/expert-only.com\/en\/t-sql\/implicit-conversion-from-xml-to-nvarchar\/\">query to convert a SQL Server XML variable to text<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"7dTPAGO4XA\"><a href=\"https:\/\/expert-only.com\/en\/t-sql\/implicit-conversion-from-xml-to-nvarchar\/\">Implicit conversion from data type XML to NVARCHAR T-SQL error<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Implicit conversion from data type XML to NVARCHAR T-SQL error&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/t-sql\/implicit-conversion-from-xml-to-nvarchar\/embed\/#?secret=Au2QStNn3e#?secret=7dTPAGO4XA\" data-secret=\"7dTPAGO4XA\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Query to store the contents of a SQL Server column in a variable, inline and with delimiters. SQL tutorial to read and store the result from a SQL Server column in a variable, and with separators. In some cases, <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\" title=\"Store a SQL Server column in a variable with delimiters\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":10704,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-18925","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>Store a SQL Server column in a variable with delimiters - T-SQL<\/title>\n<meta name=\"description\" content=\"To store a SQL Server column in a variable with delimiters, use the T-SQL built-in text function COLAESCE with a select query.\" \/>\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\/store-a-sql-server-column-in-a-variable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Store a SQL Server column in a variable with delimiters\" \/>\n<meta property=\"og:description\" content=\"To store a SQL Server column in a variable with delimiters, use the T-SQL built-in text function COLAESCE with a select query.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\" \/>\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=\"2022-11-10T05:44:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-01T07:43:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_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=\"4 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\/store-a-sql-server-column-in-a-variable\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"Store a SQL Server column in a variable with delimiters\",\"datePublished\":\"2022-11-10T05:44:00+00:00\",\"dateModified\":\"2022-12-01T07:43:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\"},\"wordCount\":418,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\",\"name\":\"Store a SQL Server column in a variable with delimiters - T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg\",\"datePublished\":\"2022-11-10T05:44:00+00:00\",\"dateModified\":\"2022-12-01T07:43:35+00:00\",\"description\":\"To store a SQL Server column in a variable with delimiters, use the T-SQL built-in text function COLAESCE with a select query.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Store a SQL Server column in a variable with delimiters\"}]},{\"@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":"Store a SQL Server column in a variable with delimiters - T-SQL","description":"To store a SQL Server column in a variable with delimiters, use the T-SQL built-in text function COLAESCE with a select query.","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\/store-a-sql-server-column-in-a-variable\/","og_locale":"en_US","og_type":"article","og_title":"Store a SQL Server column in a variable with delimiters","og_description":"To store a SQL Server column in a variable with delimiters, use the T-SQL built-in text function COLAESCE with a select query.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2022-11-10T05:44:00+00:00","article_modified_time":"2022-12-01T07:43:35+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"Store a SQL Server column in a variable with delimiters","datePublished":"2022-11-10T05:44:00+00:00","dateModified":"2022-12-01T07:43:35+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/"},"wordCount":418,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/","url":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/","name":"Store a SQL Server column in a variable with delimiters - T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg","datePublished":"2022-11-10T05:44:00+00:00","dateModified":"2022-12-01T07:43:35+00:00","description":"To store a SQL Server column in a variable with delimiters, use the T-SQL built-in text function COLAESCE with a select query.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/idea-93432E0FFA4_1920x1080.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/store-a-sql-server-column-in-a-variable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"Store a SQL Server column in a variable with delimiters"}]},{"@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\/18925","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=18925"}],"version-history":[{"count":0,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/18925\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/10704"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=18925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=18925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=18925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}