In SQL Server, you can convert any uppercase string to lowercase by using the LOWER()
function.
Simply provide the string as an argument when you call the function, and it will be returned in lowercase form.
Syntax
Here’s the official syntax:
LOWER ( character_expression )
Where character_expression
is an expression of character or binary data. This can be a constant, variable, or column. It must be of a data type that is implicitly convertible to varchar. If not, you can use the CAST()
function to convert it.
Example 1 – Basic Usage
Here’s an example of LOWER()
in action:
SELECT LOWER('POSITIVITY');
Result:
positivity
And we get the same result even if the original string already contains lowercase characters:
SELECT LOWER('Positivity');
Result:
positivity
Example 2 – Database Example
Here’s an example that returns data from a database and converts it to lowercase:
USE Music; SELECT TOP 5 AlbumName AS Original, LOWER(AlbumName) AS Lowercase FROM Albums;
Result:
Original Lowercase ---------------------- ---------------------- Powerslave powerslave Powerage powerage Singing Down the Lane singing down the lane Ziltoid the Omniscient ziltoid the omniscient Casualties of Cool casualties of cool
You can also use UPPER()
in the same way to convert a string expression to uppercase.