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
 General SQL Server Forums
 New to SQL Server Programming
 Convert string frrom capital letter to low case

Author  Topic 

eugz
Posting Yak Master

210 Posts

Posted - 2009-10-27 : 11:29:43
Hi All.
In case if string look like ASDFSDF-BWETIUWEPT. How to convert that string to keep first letter of first part and first letter of second part capital letter and rest convert to low case letter?
Thanks.

mfemenel
Professor Frink

1421 Posts

Posted - 2009-10-27 : 12:00:02

declare @mystring varchar(100)
set @mystring ='ASDFSDF-BWETIUWEPT'
select left(@mystring,1)+lower(substring(@mystring,2,charindex('-',@mystring)-1))+
substring(@mystring,charindex('-',@mystring)+1,1)
+lower(substring(@mystring,charindex('-',@mystring)+2,len(@mystring)-charindex('-',@mystring)+2))


Mike
"oh, that monkey is going to pay"
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-10-27 : 13:20:25
Use a Proper Case Function. Can be found here.

http://vyaskn.tripod.com/code/propercase.txt
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-27 : 13:34:40
if possible, it would be better to do this at your front end
Go to Top of Page

eugz
Posting Yak Master

210 Posts

Posted - 2009-10-27 : 14:12:37
Thanks for help.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-10-27 : 17:18:16
what frontend are you using ?
Go to Top of Page
   

- Advertisement -