Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqlpal2007
Posting Yak Master
200 Posts |
Posted - 2007-10-04 : 10:51:17
|
Hi All,I have the employee names where I need the first letter of the word has to be uppcase and rest of the word to be lower case.for example:Marie RENDA - Marie RendaJOHN HOFF - John HoffKathy L. LOWIES - Kathy L. LowiesCan any one tell me how to write the update to make this change.Thanks,-P |
|
Van
Constraint Violating Yak Guru
462 Posts |
Posted - 2007-10-04 : 10:53:08
|
Enter Peso in 4...3...2...1lol |
 |
|
sqlpal2007
Posting Yak Master
200 Posts |
Posted - 2007-10-04 : 11:02:56
|
Thanks VanCan you be more clear on your reply? |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
|
Van
Constraint Violating Yak Guru
462 Posts |
Posted - 2007-10-04 : 11:10:58
|
It was a joke...Peso would have the answer faster than he could type it. Here is some code that might help. It may not be the most efficient way to do it and I'll probably get shot down for it....declare @name varchar(50)select @name = 'a_VeRY_FunnY_FIRsT_NAMe a_verY_funNy_LasT_namE'select upper(left(@Name, 1))+lower(substring(@name,2,charindex(' ',@name)-2))+' '+upper(substring(@name,charindex(' ',@name)+1,1))+lower(substring(@name, charindex(' ',@name)+2,100)) |
 |
|
sqlpal2007
Posting Yak Master
200 Posts |
Posted - 2007-10-04 : 12:56:35
|
Thanks for the reply Harsh. That was really helpful for my problem.Thanks again-P |
 |
|
sqlpal2007
Posting Yak Master
200 Posts |
Posted - 2007-10-04 : 12:57:26
|
Thanks Van for your suggestion. Harsh's response worked exactly I expected to be. |
 |
|
|
|
|
|
|