--- title: "lower-case Function (XQuery) | Microsoft Docs" ms.custom: "" ms.date: "03/09/2017" ms.prod: sql ms.prod_service: sql ms.reviewer: "" ms.technology: xml ms.topic: "language-reference" dev_langs: - "XML" helpviewer_keywords: - "lower-case Function (XQuery)" - "lower-case" ms.assetid: 5222c4ff-890c-4d57-8506-c065a5ebfd3e author: "rothja" ms.author: "jroth" --- # Functions on String Values - lower-case [!INCLUDE[tsql-appliesto-ss2012-xxxx-xxxx-xxx-md](../includes/tsql-appliesto-ss2012-xxxx-xxxx-xxx-md.md)] The lower-case function converts each character in *$arg* to its lower case equivalent. The Microsoft Windows binary case conversion for Unicode code points specifies how characters are converted to lower case. This standard is not identical to the mapping for Unicode code point standard. ## Syntax ``` fn:lower-case($arg as xs:string?) as xs:string ``` ## Arguments ||| |-|-| |Term|Definition| |*$arg*|The string value to be converted to lower case.| ## Remarks If the value of *$arg* is empty, a zero length string is returned. ## Examples ### A. Changing a string to upper case The following example changes the input string 'abcDEF!@4' to lower case. ``` DECLARE @x xml = N'abcDEF!@4'; SELECT @x.value('fn:lower-case(/text()[1])', 'nvarchar(10)'); ``` [!INCLUDE[ssResult](../includes/ssresult-md.md)] `abcdef!@4` ### B. Search for a specific character string This example shows you how to use the lower-case function to perform a case insensitive search. ``` USE AdventureWorks GO --WITH XMLNAMESPACES clause specifies the namespace prefix --to use. WITH XMLNAMESPACES ('https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription' AS pd) --The XQuery contains() function is used to determine whether --any of the text nodes below the element contain --the word 'frame'. The lower-case() function makes the --case insensitive. SELECT ProductModelID, CatalogDescription.query(' { /pd:ProductDescription/@ProductModelID } { /pd:ProductDescription/pd:Summary } ') as Result FROM Production.ProductModel where CatalogDescription.exist(' /pd:ProductDescription/pd:Summary//text()[ contains(lower-case(.), "FRAME")]') = 1 ``` [!INCLUDE[ssResult](../includes/ssresult-md.md)] `ProductModelID Result` `-------------- ---------` `19 ` `` `Our top-of-the-line competition mountain bike.` `Performance-enhancing options include the innovative HL Frame,` `super-smooth front suspension, and traction for all terrain.` `` `` `` `25 ` `` `This bike is ridden by race winners. Developed with the` `Adventure Works Cycles professional race team, it has a extremely light` `heat-treated aluminum frame, and steering that allows precision control.` `` `` `` ## See Also [XQuery Functions against the xml Data Type](../xquery/xquery-functions-against-the-xml-data-type.md)