See Corey's posting here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36527 The term for what you are doing is converting to "proper case". Googleing for that should turn up more info. Here is another vesion: http://vyaskn.tripod.com/code/propercase.txt
Remembered this too:
CREATE FUNCTION dbo.fCapFirst(@input NVARCHAR(4000)) RETURNS NVARCHAR(4000)
AS
BEGIN
DECLARE @position INT
WHILE IsNull(@position,Len(@input)) > 1
SELECT @input = Stuff(@input,IsNull(@position,1),1,upper(substring(@input,IsNull(@position,1),1))),
@position = charindex(' ',@input,IsNull(@position,1)) + 1
RETURN (@input)
END
It's not as sophisticated as the others but it's about 3 times as fast:
select dbo.fCapFirst(Lower(Column)) From MyTable
--Ken
Your Kung-Fu is not strong. -- 'The Core'