SQL UCASE() | UPPER() Function


The SQL UCASE() | UPPER() is a function, and converts the value of a column to uppercase.

The SQL UCASE() | UPPER() function is supports only character based column and it will not work on a numeric field.

It can be used in any valid SQL SELECT statement as well in SQL where clause.


SQL UCASE() | UPPER() Syntax

For MS Access / ORACLE / MY SQL


//  Convert a input string or text expression to uppercase

SELECT UCASE(string or text);

//  Convert a specific table column value to uppercase

SELECT UCASE(column_name1) FROM table_name;

For SQL SERVER / MYSQL


//  Convert a input string or text expression to uppercase

SELECT UPPER(string or text);

//  Convert a specific table column value to uppercase

SELECT UPPER(column_name1) FROM table_name;


SQL UCASE() | UPPER() Example - Using Expression Or Formula

The following SQL SELECT statement will convert of a given input string to uppercase:

For MS Access / ORACLE / MY SQL


SELECT UCASE('WWW.SimmanChith.COM');

For SQL SERVER / MYSQL


SELECT UPPER('WWW.SimmanChith.COM');

The result of above query is:

Expr
WWW.SIMMANCHITH.COM

SQL UCASE() | UPPER() Function More Example

Input Value Result
UCASE('Sql DataBase Tutorial') SQL DATABASE TUTORIAL
UCASE('SQL DB 5.0') SQL DB 5.0

Sample Database Table - Employee

ID EmpName Designation Dept JoinYear Salary
1 Devi Mai SQL Security SQL Server 2013 21320
2 Vidyavathi Database Developer MS Access 2014 12290.1
3 Sakunthala Project Lead Java 2015 16280
4 Pandurengan Project Manager ASP.Net 2014 15650.8
5 Varshini Kutty Manager SQL Server 2014 16070.2
6 Siva Kumar Sql Team Adminstrator ASP.Net 2013 16910.2
7 Azaghu Varshith Data Analyzer JQuery 2015 9560
8 Geetha Project Manager JQuery 2015 16700

SQL UCASE() | UPPER() Example

The following SQL statement selects the "ID" and "Dept" fields from the "Employee" table, and converts the "Dept" column to uppercase:

For MS Access / ORACLE / MY SQL


SELECT ID, 
UCASE(Dept) As 'Dept Column In Upper Case' 
FROM Employee;

For SQL SERVER / MYSQL


SELECT ID, 
UPPER(Dept) As 'Dept Column In Upper Case' 
FROM Employee;

The result of above query is:

ID Dept Column In Upper Case
1 SQL SERVER
2 MS ACCESS
3 JAVA
4 ASP.NET
5 SQL SERVER
6 ASP.NET
7 JQUERY
8 JQUERY

Search Keys

  • sql convert to uppercase
  • sql first letter uppercase
  • sql string uppercase
  • sql uppercase first letter
  • sql case sensitive
  • sql case insensitive
  • sql server case sensitive query
  • sql compare case sensitive