SQL UPPER, UCASE Function

Saturday, December 10, 2011

tags SQL

The UPPER function converts the value of a field to uppercase. The UPPER function is used for SQL Server. Other SQL platforms may use the UCASE function.

Employees Table

employeeIDemployeeNameage
1000John Smith40
1001Fred White27
1002Jane Scott53
1003Samuel Williams31


In this example, we want to find to see convert the employeeName field to uppercase in the query results.


Syntax

SELECT UPPER(column_name)
FROM Table


Example
SELECT UPPER(employeeName) as [EMPLOYEE NAME]
FROM employees


Results

EMPLOYEE NAME
JOHN SMITH
FRED WHITE
JANE SCOTT
SAMUEL WILLIAMS

The SQL UPPER function is used to convert a given field in a table to uppercase characters.

Did you find the page informational and useful? Share it using one of your favorite social sites.

Recommended Books & Training Resources

Head First SQL: Your Brain on SQL A Learners Guide SQL Cookbook