SQL Server UPPER() Function: Converts String to Upper Case

In SQL Server, the UPPER() function converts the input string to upper case.

UPPER(character_expression)

Parameters

character_expression: A string that has to be converted to uppercase. It can be a string or binary value. It can be a constant, variable, or table column. Also, it must be of the data type that is implicitly convertible to varchar data type.

Return Value

Returns the upper case string of type varchar or nvarchar.

Example 1:

In the following example, a simple statement is converted to uppercase

Example: UPPER()
SELECT UPPER('Hello world') AS UpperText;

Example 2:

In this example, the UPPER() function is used with a table column LastName of Employee table.

Example: UPPER()
SELECT UPPER(LastName) + SPACE(1) + FirstName AS EmployeeName FROM Employee;
Want to check how much you know SQL Server?