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 Column Name values into uppercase using UPPER function.
SELECT Id, Name, UPPER(Name) AS [Name_In_Uppercase] FROM dbo.NameList
As you can see, name values are converted into uppercase.
1,168 total views, 2 views today
Kindly change the meaning of upper() function : it converts all character to upper case.
Thanks for correcting it