Often people ask how to use InitCap function in SQL Server
Initcap is used to capitalise each first letter of the word and keep rest as non-capital
Pinal Dave has a post at http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case
Joe Celko gave an idea of nesting the replace function in the comment section
I have simplfied his suggestion and here it is
declare @string varchar(1000), @proper_string varchar(1000)
set @string='THis is fOR teSTIng'
set @proper_string=lower(@string)
set @proper_string=
replace(replace(replace(replace(replace(replace(replace(
replace(replace(replace(replace(replace(replace(replace(
replace(replace(replace(replace(replace(replace(replace(
replace(replace(replace(replace(replace(
' '+@proper_string,
' a',' A'),' b',' B'),' c',' C'),' d',' D'),' e',' E'),' f',' F'),
' g',' G'),' h',' H'),' i',' I'),' j',' J'),' k',' K'),' l',' L'),
' m',' M'),' n',' N'),' o',' O'),' p',' P'),' q',' Q'),' r',' R'),
' s',' S'),' t',' T'),' u',' U'),' v',' V'),' w',' W'),' x',' X'),
' y',' Y'),' z',' Z')
select ltrim(@string) as original_string,ltrim(@proper_string) as Init_cap