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..
Kindly change the meaning of upper() function : it converts all character to upper case.
Thanks for correcting it