SQL changing a value to upper or lower case

How do you make a field in a sql select statement all upper or lower case?

Example:

select firstname from Person

How do I make firstname always return upper case and likewise always return lower case?


SELECT UPPER(firstname) FROM Person

SELECT LOWER(firstname) FROM Person

LCASE or UCASE respectively.

Example:

SELECT UCASE(MyColumn) AS Upper, LCASE(MyColumn) AS Lower
FROM MyTable

SQL SERVER 2005:

print upper('hello');
print lower('HELLO');

You can use LOWER function and UPPER function. Like

SELECT LOWER('THIS IS TEST STRING')

Result:

this is test string

And

SELECT UPPER('this is test string')

result:

THIS IS TEST STRING