Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Case Sensitive

Status
Not open for further replies.

krotha

Programmer
Nov 5, 2000
116
US
Hi
How shall change my records upper case to lower case.
For example "INSIDE CIRCULATION" to "Inside Circulation". "JOHN SMITH" to "John Smith". I have 60,000 records in my table and I want to convert all of them First Character is upper remaining lower,after space first character is upper and remaining lower.

Any help will be appreciated.

Thanks
 
Syntax
LOWER ( character_expression )

Arguments
character_expression

Is an expression of character or binary data. character_expression can be a constant, variable, or column. character_expression must be of a data type that is implicitly convertible to varchar. Otherwise, use CAST to explicitly convert character_expression.

Return Types
varchar

Examples
This example uses the LOWER function, the UPPER function, and nests the UPPER function inside the LOWER function in selecting book titles that have prices between $11 and $20.

USE pubs
GO
SELECT LOWER(SUBSTRING(title, 1, 20)) AS Lower,
UPPER(SUBSTRING(title, 1, 20)) AS Upper,
LOWER(UPPER(SUBSTRING(title, 1, 20))) As LowerUpper
FROM titles
WHERE price between 11.00 and 20.00
GO

This is from Books online
 
will post another one after relizing you wanted to keep first character upercase.. in a few minutes
 
SUBSTRING ( expression , start , length ) - retrive a portion of the string.

LEN ( string_expression ) - tells you length of the string -- use this when you need to obtain a substring combined with CHARINDEX to find the postion the space is in the string.

CHARINDEX ( expression1 , expression2 [ , start_location ] ) -- use this to obtain position of space in string


LOWER ( character_expression ) -- use this to set the characters to lowerspace



sorry ran out of time to create the script but these are the functions you need
 
Thanks a lot. It gives me lot of information.

Once again thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top