Skip to content

SQL UPPER() function converts all the characters in a string into uppercase.




Syntax

UPPER(input string)

Lets look at an example of UPPER() function in SQL.

Following statement uses UPPER function and converts all the character in string into uppercase.

DECLARE @String AS VARCHAR(10)='microsoft'

SELECT @String AS [String], UPPER(@String) AS [Output]

select * from categories ;

 

 


 

Converts column values to uppercase using UPPER Function

Lets create a table named NameList and insert some records into this.

CREATE TABLE dbo.NameList
(Id INT, 
Name VARCHAR(50)
)

INSERT INTO dbo.NameList
(Id, Name)
VALUES
(1, 'Jack Hanery'),
(2, 'Joshep Mac'),
(3, 'Rozer Jr'),
(4, 'Mustafha Md.')

Now, we have a table as shown below.

SELET * from dbo.NameList

Lets converts the values in column name into uppercase using UPPER function.

SELECT Id, Name, UPPER(Name) AS [Name_In_Uppercase]
FROM dbo.NameList

As you can see, values in column name are converted into uppercase.

Also Read..

SQL LOWER() Function




Loading

2 thoughts on “SQL UPPER()”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.