SQL UCASE() and SQL-Server UPPER() Function Example



SQL UCASE() and SQL-Server UPPER() Function

SQL UCASE() and SQL Server UPPER() both function used to convert text to uppercase and return it. In SQL we use UCASE() function and in sql server we use UPPER() for same purpose.
sql ucase and upper
SQL UCASE() and SQL Server UPPER() function
SQL UCASE() – The UCASE() function used to convert text to uppercase and return it.
The syntax of UCASE() for SQL:
SELECT UCASE(col_name) FROM Table_Name
UPPER() – The UPPER() function is used in sql server to convert text to uppercase and return it.
The syntax for UPPER() in SQL Server:
SELECT UPPER(col_name) FROM Table_Name

Here,  SQL Table_Name = StudentMst

SELECT * FROM StudentMst

ID Name City Pincode Mobile
1 Meera Bombay 380022 7874555555
2 Rahul Surat 352200 7874444444
3 Jayesh Ahmedabad 352200 7874333333
4 Dhvanish Bombay 380022 7874111111
5 Reena Baroda 352222 7874666666
6 Veera Baroda 352222 7874121212

 

Below sql statement select the column Name and City from table StudentMst and convert both column to uppercase.

SELECT UCASE(Name) AS Name, UCASE(City) AS City FROM StudentMst

Name City
MEERA BOMBAY
RAHUL SURAT
JAYESH AHMEDABAD
DHAVNISH BOMBAY
REENA BARODA
VEERA BARODA

 

Below sql server statement select the column Name and City from table StudentMst and convert both column to uppercase.

SELECT UPPER(Name) AS Name, UPPER(City) AS City FROM StudentMst

Name City
MEERA BOMBAY
RAHUL SURAT
JAYESH AHMEDABAD
DHAVNISH BOMBAY
REENA BARODA
VEERA BARODA

Leave a Reply

Your email address will not be published. Required fields are marked *