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 2008 Forums
 Transact-SQL (2008)
 Captilise first letter of each word

Author  Topic 

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2011-08-16 : 06:40:55
Hi

Does anybody have a function/script which would allow capitalisation of the first letter in each word (when not a number) i.e.

I will be receiving data in various formats and want a consistent format to use for possible mailmerge data. The number of words can vary in the field

1 SHOE ROAD -> 1 Shoe Road
potters hosue -> Potters House
GOLDEN GATE BRIDGE -> Golden Gate Bridge

Many thanks!

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-08-16 : 07:00:44
There are couple of methods discussed in this thread: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=146068
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-08-16 : 07:00:52
maybe here is something for you?
http://www.sqlteam.com/search.aspx?cx=011171816663894899992%3Aaow51lf_dim&cof=FORID%3A9&q=capitalize+words#1200


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-08-29 : 07:32:21
You may also find this interesting
http://beyondrelational.com/blogs/madhivanan/archive/2010/07/19/initcap-function.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-29 : 07:38:57
why should you do it in DB? do you have presentation layer where you can handle this?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -