MS SQL Server UPPER() Function
Sometimes you many need to convert lowercase character data to uppercase in MS SQL Server. There is a function called UPPER
in MS SQL Server by which you can do this. UPPER
function returns a character expression after converting lowercase character data to uppercase.
Let’s see the function syntax:
UPPER(character_expression);
In this syntax:
- In this function there is one parameters character_expression.
- Parameter character_expression is an expression of character or binary data.
- Parameter character_expression can be a constant, variable, or column.
- Returns data type of varchar or nvarchar data.
- Function returns a character expression after converting lowercase character data to uppercase.
The following example uses UPPER
function to convert lowercase character data to uppercase.
DECLARE @input varchar(60); SET @input = 'Minhajur Rahman Khan'; SELECT @input AS 'original_string', UPPER(@input) AS 'upper_case_string';
Here is the result set.
original_string | upper_case_string |
---|---|
Minhajur Rahman Khan | MINHAJUR RAHMAN KHAN |
I have an another post MS SQL Server String Related Functions where you will learn about different string related functions of MS SQL Server.
In this tutorial, I have shown you how to convert lowercase character data to uppercase in MS SQL Server. Hope you have enjoyed the tutorial. If you want to get updated, like my facebook page http://www.facebook.com/freetechtrainer and stay connected.