Brettb.Com
  HOME | ABOUT ME | BIOTECHNOLOGY | ARTICLES | GALLERY | CONTACT
Search: Go
TECHNICAL ARTICLES
 ASP
 ASP.NET
 JavaScript
 Transact SQL
 Other Articles
 Software Reviews

PHOTO GALLERIES
 Canon EOS 300D Samples
 Akihabara Maids!
 More Galleries...

TRAVEL LOG
 2009: China
 2008: Tokyo
 2007: Tokyo
 2006: Hong Kong
 2005: New York City

MORE STUFF
 Search Engine Optimisation
 Build an ASP Search Engine
 My Tropical Fishtank
 Autoglass
 SQL Month Name
 SQL Get Date Today
 SQL Year Month
 Other New Stuff...

POPULAR STUFF
 Regular Expressions
 Index Server & ASP
 JavaScript Ad Rotator

Home > Articles > Transact SQL Programming Articles

Changing Case of Strings (Upper and Lower Case)

Changing Strings to Lower Case

The Transact SQL Lower function is used to convert strings to all lower case. For example, the following statement returns a lower case ProductName from the Products table of the Northwind sample database:

SELECT LOWER(ProductName) as ProductName FROM Products

Changing Strings to Upper Case

The Transact SQL Upper function is used to convert strings to all upper case (i.e. capitals). For example, the following statement returns an upper case ProductName from the Products table of the Northwind sample database:

SELECT UPPER(ProductName) as ProductName FROM Products

Changing the Case of Database Table Columns

If you need to permanently change the case of text within specific database columns, then a SQL statement like the following can be used:

UPDATE Products SET ProductName = UPPER(ProductName)

A WHERE clause could also be used if only certain rows needed to be changed.

Useful Links

  • The SQL Documentation Tool builds technical documentation for Microsoft SQL Server databases. A free trial version is available for download.

  Site Map | Privacy Policy

All content is 1995 - 2012