Returns a character expression with lowercase character data converted to uppercase.
UPPER(character_expression)
varchar
character_expression must be of a data type that is implicitly convertible to varchar. Otherwise, use the CAST function to explicitly convert character_expression.
This example uses the UPPER and RTRIM functions to return the trimmed, uppercase author’s last name concatenated with the author’s first name.
USE pubs
GO
SELECT UPPER(RTRIM(au_lname)) + ', ' + au_fname AS Name
FROM authors
ORDER BY au_lname
GO
Here is the result set:
Name
--------------------------------------------------------------
BENNET, Abraham
BLOTCHET-HALLS, Reginald
CARSON, Cheryl
DEFRANCE, Michel
DEL CASTILLO, Innes
DULL, Ann
GREEN, Marjorie
GREENE, Morningstar
GRINGLESBY, Burt
HUNTER, Sheryl
KARSEN, Livia
LOCKSLEY, Charlene
MACFEATHER, Stearns
MCBADDEN, Heather
O'LEARY, Michael
PANTELEY, Sylvia
RINGER, Albert
RINGER, Anne
SMITH, Meander
STRAIGHT, Dean
STRINGER, Dirk
WHITE, Johnson
YOKOMOTO, Akiko
(23 row(s) affected)
Data Types | String Functions |