{"id":5376,"date":"2013-04-27T00:00:09","date_gmt":"2013-04-27T00:00:09","guid":{"rendered":"http:\/\/craftydba.com\/?p=5376"},"modified":"2017-10-08T16:21:55","modified_gmt":"2017-10-08T16:21:55","slug":"string-functions-upper","status":"publish","type":"post","link":"https:\/\/craftydba.com\/?p=5376","title":{"rendered":"String Functions &#8211; UPPER()"},"content":{"rendered":"<p><a href=\"https:\/\/craftydba.com\/wp-content\/uploads\/2013\/04\/turquoise-yarn-md.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-5158\" title=\"turquoise-yarn-md\" src=\"https:\/\/craftydba.com\/wp-content\/uploads\/2013\/04\/turquoise-yarn-md-150x150.png\" alt=\"\" width=\"150\" height=\"150\" \/><\/a><br \/>\nI am going to continue my series of very short articles or tidbits on Transaction SQL string functions. I will exploring the UPPER() function today.<\/p>\n<p>The <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms180055.aspx\">UPPER()<\/a> function takes a source string as input and returns a output string with all alpha characters converted to upper case.<\/p>\n<p>The following example converts the favorite movie title of mine to upper case.<\/p>\n<pre class=\"lang:TSQL theme:familiar mark:1,2-3\" title=\"string functions - upper()\">\r\n \r\n-- Make my string upper case\r\nselect upper('wizard of oz') as str_phrase\r\n \r\n<\/pre>\n<\/p>\n<pre class=\"lang:TSQL theme:epicgeeks\" title=\"output\">\r\noutput: \r\n\r\nstr_phrase\r\n------------\r\nWIZARD OF OZ\r\n<\/pre>\n<\/p>\n<p>One thing to always worry about when using TSQL functions is how will it react with empty strings or NULL values?  Both empty strings and NULL values as input return themselves as output.  <\/p>\n<pre class=\"lang:TSQL theme:familiar mark:1,2-3\" title=\"string functions - upper()\">\r\n-- Empty string returns empty string\r\nselect upper('') as str_phrase\r\n\r\n-- Null returns Null\r\nselect upper(NULL) as str_phrase\r\n<\/pre>\n<\/p>\n<pre class=\"lang:TSQL theme:epicgeeks\" title=\"output\">\r\noutput: \r\n\r\nstr_phrase\r\n----------\r\n\r\nstr_phrase\r\n----------\r\nNULL\r\n<\/pre>\n<\/p>\n<p>This is the final <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms181984.aspx\">string function<\/a> to review in the SQL Server 2012 T-SQL language reference.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am going to continue my series of very short articles or tidbits on Transaction SQL string functions. I will exploring the UPPER() function today. The UPPER() function takes a source string as input and returns a output string with all alpha characters converted to upper case. The following example converts the favorite movie title of mine to upper case. &#8212; Make my string upper case select upper(&#8216;wizard of oz&#8217;) as str_phrase output: str_phrase &#8212;&#8212;&#8212;&#8212; WIZARD OF OZ One thing to always worry about when using TSQL functions is how&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[814],"tags":[31,15,831,815,29],"class_list":["post-5376","post","type-post","status-publish","format-standard","hentry","category-very-short-articles","tag-database-developer","tag-john-f-miner-iii","tag-soundex","tag-string-function","tag-tsql"],"_links":{"self":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/posts\/5376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5376"}],"version-history":[{"count":0,"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/posts\/5376\/revisions"}],"wp:attachment":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}