{"id":1127,"date":"2019-02-16T16:01:18","date_gmt":"2019-02-16T09:01:18","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=1127"},"modified":"2021-04-28T14:47:20","modified_gmt":"2021-04-28T07:47:20","slug":"sql-server-string-functions","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/","title":{"rendered":"SQL Server String Functions"},"content":{"rendered":"\n<p>The following SQL Server string functions process on an input string and return a string or numeric value:<\/p>\n\n\n\n<p><input id=\"search\" class=\"light-table-filter\" type=\"text\" placeholder=\"Type a function name to search...\" data-table=\"functions\"><\/p>\n\n\n\n<figure class=\"wp-block-table responsive functions\"><table><thead><tr><th>Function<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-ascii-function\/\">ASCII<\/a><\/td><td>Return the ASCII code value of a character<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-char-function\/\">CHAR<\/a><\/td><td>Convert an ASCII value to a character<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-charindex-function\/\">CHARINDEX<\/a><\/td><td>Search for a substring inside a string starting from a specified location and return the position of the substring.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-concat-function\/\">CONCAT<\/a><\/td><td>Join two or more strings into one string<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-concat_ws-function\/\">CONCAT_WS<\/a><\/td><td>Concatenate multiple strings with a separator into a single string<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-difference-function\/\">DIFFERENCE<\/a><\/td><td>Compare the SOUNDEX() values of two strings<\/td><\/tr><tr><td>FORMAT<\/td><td>Return a value formatted with the specified format and optional culture<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-left-function\/\">LEFT<\/a><\/td><td>Extract a given a number of characters from a character string starting from the left<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-len-function\/\">LEN<\/a><\/td><td>Return a number of characters of a character string<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-lower-function\/\">LOWER<\/a><\/td><td>Convert a string to lowercase<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-ltrim-function\/\">LTRIM<\/a><\/td><td>Return a new string from a specified string after removing all leading blanks<\/td><\/tr><tr><td>NCHAR<\/td><td>Return the Unicode character with the specified integer code, as defined by the Unicode standard<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-patindex-function\/\">PATINDEX<\/a><\/td><td>Returns the starting position of the first occurrence of a pattern in a string.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-quotename-function\/\">QUOTENAME<\/a><\/td><td>Returns a Unicode string with the delimiters added to make the input string a valid delimited identifier<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-replace-function\/\">REPLACE<\/a><\/td><td>Replace all occurrences of a substring, within a string, with another substring<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-replicate-function\/\">REPLICATE<\/a><\/td><td>Return a string repeated a specified number of times<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-reverse-function\/\">REVERSE<\/a><\/td><td>Return the reverse order of a character string<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-right-function\/\">RIGHT<\/a><\/td><td>Extract a given a number of characters from a character string starting from the right<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-rtrim-function\/\">RTRIM<\/a><\/td><td>Return a new string from a specified string after removing all trailing blanks<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-soundex-function\/\">SOUNDEX<\/a><\/td><td>Return a four-character (SOUNDEX) code of a string based on how it is spoken<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-space-function\/\">SPACE<\/a><\/td><td>Returns a string of repeated spaces.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-str-function\/\">STR<\/a><\/td><td>Returns character data converted from numeric data.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-string_agg-function\/\">STRING_AGG<\/a><\/td><td>Concatenate rows of strings with a specified separator into a new string<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-string_escape-function\/\">STRING_ESCAPE<\/a><\/td><td>Escapes special characters in a string and returns a new string with escaped characters<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-string_split-function\/\">STRING_SPLIT<\/a><\/td><td>A table-valued function that splits a string into rows of substrings based on a specified separator.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-stuff-function\/\">STUFF<\/a><\/td><td>Delete a part of a string and then insert another substring into the string starting at a specified position.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-substring-function\/\">SUBSTRING<\/a><\/td><td>Extract a substring within a string starting from a specified location with a specified length<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-translate-function\/\">TRANSLATE<\/a><\/td><td>Replace several single-characters, one-to-one translation in one operation.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-trim-function\/\">TRIM<\/a><\/td><td>Return a&nbsp;new string from a specified string after removing all leading and trailing blanks<\/td><\/tr><tr><td>UNICODE<\/td><td>Returns the integer value, as defined by the Unicode standard, of a character.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/sql-server-upper-function\/\">UPPER<\/a><\/td><td>Convert a string to uppercase<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.<\/p>\n","protected":false},"author":1,"featured_media":2759,"parent":0,"menu_order":12,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1127","page","type-page","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Server String Functions<\/title>\n<meta name=\"description\" content=\"This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server String Functions\" \/>\n<meta property=\"og:description\" content=\"This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-28T07:47:20+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/\",\"name\":\"SQL Server String Functions\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/sql-server-string-functions.svg\",\"datePublished\":\"2019-02-16T09:01:18+00:00\",\"dateModified\":\"2021-04-28T07:47:20+00:00\",\"description\":\"This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/sql-server-string-functions.svg\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/sql-server-string-functions.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-string-functions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server String Functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Server String Functions","description":"This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.","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:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server String Functions","og_description":"This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2021-04-28T07:47:20+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/","name":"SQL Server String Functions","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/sql-server-string-functions.svg","datePublished":"2019-02-16T09:01:18+00:00","dateModified":"2021-04-28T07:47:20+00:00","description":"This tutorial provides with many useful SQL Server String functions that allow you to manipulate character string effectively.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/sql-server-string-functions.svg","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/sql-server-string-functions.svg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-string-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server String Functions"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/1127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=1127"}],"version-history":[{"count":1,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/1127\/revisions"}],"predecessor-version":[{"id":2762,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/1127\/revisions\/2762"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media\/2759"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=1127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}