[dba-SQLServer]Proper case?

Billy Pang tuxedo_man at hotmail.com
Wed Jul 30 11:18:23 CDT 2003


Thanks Karen for the case functions.
The firstLetterUpperCase returned Proper case, which was what I asked for.

Billy


>From: "Nicholson, Karen" <knicholson at gpsx.net>
>Reply-To: dba-sqlserver at databaseadvisors.com
>To: dba-sqlserver at databaseadvisors.com
>Subject: RE: [dba-SQLServer]Proper case?
>Date: Wed, 30 Jul 2003 07:44:23 -0500
>
>Or:
>
>create  FUNCTION firstLetterUpperCase (@item varchar(100))
>RETURNS varchar(100) AS
>BEGIN
>
>Declare @str varchar(100),
>     @idx int,
>     @strLength int
>
>set @idx = charindex (' ', @Item, 1)
>
>if (@item is null) or len (@item)  = 0
>     return @item
>
>
>set @strLength = len (@item)
>
>set @str = lower (@Item)
>set @str = upper (substring (@str, 1, 1)) + substring (@str, 2, @strLength
>-1)
>
>while @idx > 0
>begin
>     set @str = substring (@str, 1, @idx ) + upper (substring (@str, 
>@idx+1,
>1)) +  substring (@str, @idx + 2, @strLength - (@idx + 1))
>      set @idx = charindex (' ', @item, @idx + 2)
>end
>
>return @str
>
>END
>
>
>
>-----Original Message-----
>From: Billy Pang [mailto:tuxedo_man at hotmail.com]
>Sent: Tuesday, July 29, 2003 10:07 PM
>To: dba-SQLServer at databaseadvisors.com
>Subject: [dba-SQLServer]Proper case?
>
>
>Is there a "proper case" function within SQL Server?  I know that there is
>UPPER and LOWER, but what will help me convert the following:
>
>"the quick brown fox jumped.  it is over for the lazy dog."
>
>to
>
>"The quick brown fox jumped.  It is over for the lazy dog."
>
>Thanks in advance,
>Billy
>
>_________________________________________________________________
>MSN 8 with e-mail virus protection service: 2 months FREE*
>http://join.msn.com/?page=features/virus
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com
>

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus



More information about the dba-SQLServer mailing list