The SQL UPPER function converts the input character expression to an upper case and returns it.
Description
The UPPER function reads the input expression and converts lowercase characters to uppercase.
SQL UPPER Function Usage Notes
The character expression is the only argument for the UPPER function. It is the text to be converted to an upper case. The data type can be a character or a binary. The data type should be implicitly convertible to the varchar data type. Otherwise, the CAST function explicitly converts the character expression to varchar.
The input character data can be a constant, a variable, or a column value.
In the case of the NULL argument, the result is a NULL expression. The upper case character data in the input expression remains unchanged.
The return data type is varchar or nvarchar.
Syntax
UPPER (input_character_expression)
SQL UPPER Examples
The following examples show the use of the UPPER function for string manipulation in SQL.
Here is the same showing a mixed case example:
The following example uses AdventureWorks2019 database.
The query selects and displays the complete name of each person in the upper case.