LOWER (Transact-SQL)
Returns a character string with all characters converted to lowercase.
Syntax
LOWER ( character_expression )
Arguments
character_expression
Is a character string of any character data type. The input to the LOWER function can be a constant, a variable, or a column that implicitly or explicitly converts to a character string type.
Return Types
Returns a character string of the same type as the input character_expression, with all uppercase characters converted to lowercase. If the input is NULL, NULL is returned.
Examples
Example 1: Converting a string to lowercase
SELECT LOWER('HELLO WORLD');
Result:
hello world
Example 2: Using LOWER with a column
Assume a table named Products with a column named ProductName.
SELECT ProductName, LOWER(ProductName) AS LowercaseName
FROM Products;
This query will return the original ProductName and its lowercase version.
Remarks
The LOWER function is the opposite of the UPPER function. It is useful for case-insensitive comparisons or for standardizing text data.