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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Uppercase in string

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 Renda
JOHN HOFF - John Hoff
Kathy L. LOWIES - Kathy L. Lowies

Can 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...1

lol
Go to Top of Page

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2007-10-04 : 11:02:56
Thanks Van

Can you be more clear on your reply?
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-10-04 : 11:03:44
See this: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47718

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

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))
Go to Top of Page

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
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -