Tuesday 21 February 2012

MS SQL 2012 - How to Convert First letter of a string to upper case and remaining letters to lower case

Select UPPER(LEFT(RTRIM(LTRIM(CustomerFirstName)), 1)) +
LOWER(SUBSTRING(RTRIM(LTRIM(CustomerFirstName)), 2, LEN(CustomerFirstName) - 1))
 from Customer



No comments:

Post a Comment