Monday, March 26, 2012

how to make column lowercase

I have a table that contains names that are all in upper case, this column is called in many different areas of my web app. I wanted to make the names all lowercase, or with the leading character only capitalized.
How can I make a column within a SQL table lowercase at the SQL server end and not the programming side?

thanks,
Frank


UPDATE
TableName
SET
FieldName = LCASE(FieldName)

For all future entries, you create a trigger that will execute on insert.|||If you are talking about the data to be converted in lowercase, then following is the syntax:

select lower(column_name) from table_name

To convert first letter in Capital, you could write your own function, using UPPER, LOWER, SUBSTRING and CHARINDEX.
You can use CHARINDEX to find the spaces, then UPPER the character following each space.|||How can I do this automatically in the Formula field of the Table Design.

thanks

No comments:

Post a Comment