<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; UDF &#8211; Function to Convert Text String to Title Case &#8211; Proper Case</title>
	<atom:link href="http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Tom Winans</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-429326</link>
		<dc:creator><![CDATA[Tom Winans]]></dc:creator>
		<pubDate>Thu, 28 Feb 2013 19:11:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-429326</guid>
		<description><![CDATA[Written a long time ago but very helpful in 2013 ... many thanks for your continued generosity ...]]></description>
		<content:encoded><![CDATA[<p>Written a long time ago but very helpful in 2013 &#8230; many thanks for your continued generosity &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vishal Vashishta</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-373854</link>
		<dc:creator><![CDATA[Vishal Vashishta]]></dc:creator>
		<pubDate>Wed, 14 Nov 2012 06:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-373854</guid>
		<description><![CDATA[Very Useful,,, saves time]]></description>
		<content:encoded><![CDATA[<p>Very Useful,,, saves time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: canmo</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-366308</link>
		<dc:creator><![CDATA[canmo]]></dc:creator>
		<pubDate>Mon, 29 Oct 2012 22:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-366308</guid>
		<description><![CDATA[Thanks Tim for the char(9) suggestion

Pinal, you should also change the @Output declaration to match the input size:
DECLARE @OutputString VARCHAR(4000) --was (255)

or long strings will return a blank!]]></description>
		<content:encoded><![CDATA[<p>Thanks Tim for the char(9) suggestion</p>
<p>Pinal, you should also change the @Output declaration to match the input size:<br />
DECLARE @OutputString VARCHAR(4000) &#8211;was (255)</p>
<p>or long strings will return a blank!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-339599</link>
		<dc:creator><![CDATA[Andrew]]></dc:creator>
		<pubDate>Fri, 31 Aug 2012 14:44:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-339599</guid>
		<description><![CDATA[Changed SET @Index = 2 to SET @Index = 1.  Setting it as 2 assumes the first character is already uppercase -- which may no always be the case.]]></description>
		<content:encoded><![CDATA[<p>Changed SET @Index = 2 to SET @Index = 1.  Setting it as 2 assumes the first character is already uppercase &#8212; which may no always be the case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sridhar</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-330523</link>
		<dc:creator><![CDATA[sridhar]]></dc:creator>
		<pubDate>Tue, 14 Aug 2012 22:04:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-330523</guid>
		<description><![CDATA[Thanks a lot !!!]]></description>
		<content:encoded><![CDATA[<p>Thanks a lot !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Plahanov</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-326502</link>
		<dc:creator><![CDATA[Plahanov]]></dc:creator>
		<pubDate>Tue, 07 Aug 2012 12:32:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-326502</guid>
		<description><![CDATA[Thankx Pinal..... You reaaaaally saved my time .. ...

Plahanov]]></description>
		<content:encoded><![CDATA[<p>Thankx Pinal&#8230;.. You reaaaaally saved my time .. &#8230;</p>
<p>Plahanov</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Fernandes</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-274515</link>
		<dc:creator><![CDATA[Alex Fernandes]]></dc:creator>
		<pubDate>Mon, 09 Apr 2012 22:12:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-274515</guid>
		<description><![CDATA[Great function!
thanks !!]]></description>
		<content:encoded><![CDATA[<p>Great function!<br />
thanks !!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Sheth</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-270784</link>
		<dc:creator><![CDATA[Rajesh Sheth]]></dc:creator>
		<pubDate>Mon, 02 Apr 2012 10:40:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-270784</guid>
		<description><![CDATA[Great Function
its useful for update all kind of string , I used for customer name , address too.]]></description>
		<content:encoded><![CDATA[<p>Great Function<br />
its useful for update all kind of string , I used for customer name , address too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehboob</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-270050</link>
		<dc:creator><![CDATA[Mehboob]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 07:18:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-270050</guid>
		<description><![CDATA[Thank you Guru!]]></description>
		<content:encoded><![CDATA[<p>Thank you Guru!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehboob</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-270047</link>
		<dc:creator><![CDATA[Mehboob]]></dc:creator>
		<pubDate>Sat, 31 Mar 2012 07:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-270047</guid>
		<description><![CDATA[Thank you Pinal !]]></description>
		<content:encoded><![CDATA[<p>Thank you Pinal !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hafiz</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-208019</link>
		<dc:creator><![CDATA[Hafiz]]></dc:creator>
		<pubDate>Wed, 30 Nov 2011 14:37:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-208019</guid>
		<description><![CDATA[This is fantastic and was very much useful in my case. Thanks.

Hafiz]]></description>
		<content:encoded><![CDATA[<p>This is fantastic and was very much useful in my case. Thanks.</p>
<p>Hafiz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NabyL</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-195958</link>
		<dc:creator><![CDATA[NabyL]]></dc:creator>
		<pubDate>Tue, 15 Nov 2011 10:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-195958</guid>
		<description><![CDATA[This what i tried on my Database but unluckily received an error that states:
&quot;Msg 102, Level 15, State 1, Procedure ChangeTitleCase, Line 26
Incorrect syntax near &#039;)&#039;.&quot;

Please guide!!
---------------------------------------------------------------------------------

CREATE FUNCTION ChangeTitleCase (@InputString VARCHAR(4000) )
RETURNS VARCHAR(4000)
AS
BEGIN
DECLARE @Index INT
DECLARE @Char CHAR(1)
DECLARE @OutputString VARCHAR(255)
SET @OutputString = LOWER(@InputString)
SET @Index = 2
SET @OutputString =
STUFF(@OutputString, 1, 1,UPPER(SUBSTRING(@InputString,1,1)))
WHILE @Index &lt;= LEN(@InputString)
BEGIN
SET @Char = SUBSTRING(@InputString, @Index, 1)
IF @Char IN (&#039; &#039;, &#039;;&#039;, &#039;:&#039;, &#039;!&#039;, &#039;?&#039;, &#039;,&#039;, &#039;.&#039;, &#039;_&#039;, &#039;-&#039;, &#039;/&#039;, &#039;&amp;&#039;,&#039;&#039;&#039;&#039;,&#039;(&#039;)
IF @Index + 1 &lt;= LEN(@InputString)
BEGIN
IF @Char != &#039;&#039;&#039;&#039;
OR
UPPER(SUBSTRING(@InputString, @Index + 1, 1)) != &#039;S&#039;
SET @OutputString =
STUFF(@OutputString, @Index + 1, 1,UPPER(SUBSTRING(@InputString, @Index + 1, 1)))
END
SET @Index = @Index + 1
END
RETURN ISNULL(@OutputString,&#039;&#039;)]]></description>
		<content:encoded><![CDATA[<p>This what i tried on my Database but unluckily received an error that states:<br />
&#8220;Msg 102, Level 15, State 1, Procedure ChangeTitleCase, Line 26<br />
Incorrect syntax near &#8216;)&#8217;.&#8221;</p>
<p>Please guide!!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>CREATE FUNCTION ChangeTitleCase (@InputString VARCHAR(4000) )<br />
RETURNS VARCHAR(4000)<br />
AS<br />
BEGIN<br />
DECLARE @Index INT<br />
DECLARE @Char CHAR(1)<br />
DECLARE @OutputString VARCHAR(255)<br />
SET @OutputString = LOWER(@InputString)<br />
SET @Index = 2<br />
SET @OutputString =<br />
STUFF(@OutputString, 1, 1,UPPER(SUBSTRING(@InputString,1,1)))<br />
WHILE @Index &lt;= LEN(@InputString)<br />
BEGIN<br />
SET @Char = SUBSTRING(@InputString, @Index, 1)<br />
IF @Char IN (&#039; &#039;, &#039;;&#039;, &#039;:&#039;, &#039;!&#039;, &#039;?&#039;, &#039;,&#039;, &#039;.&#039;, &#039;_&#039;, &#039;-&#039;, &#039;/&#039;, &#039;&amp;&#039;,&#039;&#039;&#039;&#039;,&#039;(&#039;)<br />
IF @Index + 1 &lt;= LEN(@InputString)<br />
BEGIN<br />
IF @Char != &#039;&#039;&#039;&#039;<br />
OR<br />
UPPER(SUBSTRING(@InputString, @Index + 1, 1)) != &#039;S&#039;<br />
SET @OutputString =<br />
STUFF(@OutputString, @Index + 1, 1,UPPER(SUBSTRING(@InputString, @Index + 1, 1)))<br />
END<br />
SET @Index = @Index + 1<br />
END<br />
RETURN ISNULL(@OutputString,&#039;&#039;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Cumbie</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-195532</link>
		<dc:creator><![CDATA[Lee Cumbie]]></dc:creator>
		<pubDate>Mon, 14 Nov 2011 21:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-195532</guid>
		<description><![CDATA[What is the option if you want to actually update the permanent table?]]></description>
		<content:encoded><![CDATA[<p>What is the option if you want to actually update the permanent table?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahmed Hassan</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-183207</link>
		<dc:creator><![CDATA[Ahmed Hassan]]></dc:creator>
		<pubDate>Tue, 25 Oct 2011 05:43:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-183207</guid>
		<description><![CDATA[Thanx, this is so much helpful to me!!]]></description>
		<content:encoded><![CDATA[<p>Thanx, this is so much helpful to me!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mamun Reza</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-181118</link>
		<dc:creator><![CDATA[Mamun Reza]]></dc:creator>
		<pubDate>Thu, 20 Oct 2011 09:58:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-181118</guid>
		<description><![CDATA[Hi, thanks a lot for this helpful script. :)]]></description>
		<content:encoded><![CDATA[<p>Hi, thanks a lot for this helpful script. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Soh</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-173914</link>
		<dc:creator><![CDATA[Sam Soh]]></dc:creator>
		<pubDate>Sat, 01 Oct 2011 15:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-173914</guid>
		<description><![CDATA[Your script has saved my life!!!! Thank you very much!!!]]></description>
		<content:encoded><![CDATA[<p>Your script has saved my life!!!! Thank you very much!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elton</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-171021</link>
		<dc:creator><![CDATA[Elton]]></dc:creator>
		<pubDate>Fri, 23 Sep 2011 21:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-171021</guid>
		<description><![CDATA[Perfect function. Just copy and paste into SQL Server Management, compile and no more! Tks.]]></description>
		<content:encoded><![CDATA[<p>Perfect function. Just copy and paste into SQL Server Management, compile and no more! Tks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JIKEN</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-143452</link>
		<dc:creator><![CDATA[JIKEN]]></dc:creator>
		<pubDate>Fri, 24 Jun 2011 18:04:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-143452</guid>
		<description><![CDATA[Super duper function sir
:)]]></description>
		<content:encoded><![CDATA[<p>Super duper function sir<br />
:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafal Ziolkowski</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-136195</link>
		<dc:creator><![CDATA[Rafal Ziolkowski]]></dc:creator>
		<pubDate>Mon, 23 May 2011 10:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-136195</guid>
		<description><![CDATA[Thanks for sharing!

I have only one remark here. I think you should declare @OutputString as VARCHAR(4000) as well. Otherwise you will loose string content over 255 chars.]]></description>
		<content:encoded><![CDATA[<p>Thanks for sharing!</p>
<p>I have only one remark here. I think you should declare @OutputString as VARCHAR(4000) as well. Otherwise you will loose string content over 255 chars.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-96245</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 28 Oct 2010 07:43:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-96245</guid>
		<description><![CDATA[InitCap does not matter when you write queries until your database has a case sensitive coolation]]></description>
		<content:encoded><![CDATA[<p>InitCap does not matter when you write queries until your database has a case sensitive coolation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abdul Rahman</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-96045</link>
		<dc:creator><![CDATA[Abdul Rahman]]></dc:creator>
		<pubDate>Wed, 27 Oct 2010 04:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-96045</guid>
		<description><![CDATA[Hi

i have a question regarding this udf. English language specific the words like and, or, the are not marked as init cap, how can we handle it?

thanks in advance:
Abdul Rahman Khokhar]]></description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>i have a question regarding this udf. English language specific the words like and, or, the are not marked as init cap, how can we handle it?</p>
<p>thanks in advance:<br />
Abdul Rahman Khokhar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-89729</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Mon, 27 Sep 2010 11:17:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-89729</guid>
		<description><![CDATA[You can user PRE tag when you post code]]></description>
		<content:encoded><![CDATA[<p>You can user PRE tag when you post code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moden</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-89491</link>
		<dc:creator><![CDATA[Jeff Moden]]></dc:creator>
		<pubDate>Sun, 26 Sep 2010 03:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-89491</guid>
		<description><![CDATA[Heh... and I really hate moderated forums. ;-)]]></description>
		<content:encoded><![CDATA[<p>Heh&#8230; and I really hate moderated forums. ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moden</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-89490</link>
		<dc:creator><![CDATA[Jeff Moden]]></dc:creator>
		<pubDate>Sun, 26 Sep 2010 03:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-89490</guid>
		<description><![CDATA[Heh... like I said... the forum doesn&#039;t honor ANY formatting... not even non-breaking spaces.  The code really looks ugly compared to the original.  My apologies but theres not much I can do about it.]]></description>
		<content:encoded><![CDATA[<p>Heh&#8230; like I said&#8230; the forum doesn&#8217;t honor ANY formatting&#8230; not even non-breaking spaces.  The code really looks ugly compared to the original.  My apologies but theres not much I can do about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moden</title>
		<link>http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/#comment-89489</link>
		<dc:creator><![CDATA[Jeff Moden]]></dc:creator>
		<pubDate>Sun, 26 Sep 2010 03:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/02/01/function-to-convert-text-string-to-title-case/#comment-89489</guid>
		<description><![CDATA[Howdy.  Nicely done.  Thought I&#039;d throw my own 2 cents in here.  The following is about the fastest InitialCaps function I&#039;ve found and it will put a cap after just about anything that isn&#039;t a letter including special characters.  Heh... it&#039;s remarkably simple, too!  The original author (George Mastros) had one heck of an idea on this one!  It even beats a Tally Table solution.

It&#039;s a shame this forum doesn&#039;t honor any type of formatting... the function looks quite nice when properly formatted.  I&#039;m trying to us non-breaking spaces but, if that doesn&#039;t work, I&#039;ll just post it flat...

CREATE FUNCTION dbo.InitialCap(@String VARCHAR(8000))
/***************************************************************************************************
 Purpose:
 Capitalize any lower case alpha character which follows any non alpha character or single quote.

 Revision History:
 Rev 00 - 24 Feb 2010 - George Mastros - Initial concept
 http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/sql-server-proper-case-function

 Rev 01 - 25 Sep 2010 - Jeff Moden 
        - Redaction for personal use and added documentation.
        - Add no-cap single-quote by single-quote to the filter.
***************************************************************************************************/
RETURNS VARCHAR(8000)
     AS
  BEGIN 
----------------------------------------------------------------------------------------------------
DECLARE @Position INT
;
--===== Update the first character no matter what and then find the next postionthat we 
     -- need to update.  The collation here is essential to making this so simple.
     -- A-z is equivalent to the slower A-Z
 SELECT @String   = STUFF(LOWER(@String),1,1,UPPER(LEFT(@String,1))),
        @Position = PATINDEX(&#039;%[^A-Za-z&#039;&#039;][a-z]%&#039;,@String COLLATE Latin1_General_Bin)
;
--===== Do the same thing over and over until we run out of places to capitalize.
     -- Note the reason for the speed here is that ONLY places that need capitalization
     -- are even considered for @Position using the speed of PATINDEX. 
  WHILE @Position &gt; 0
 SELECT @String   = STUFF(@String,@Position,2,UPPER(SUBSTRING(@String,@Position,2))),
        @Position = PATINDEX(&#039;%[^A-Za-z&#039;&#039;][a-z]%&#039;,@String COLLATE Latin1_General_Bin)
;
----------------------------------------------------------------------------------------------------
 RETURN @String;
    END ;]]></description>
		<content:encoded><![CDATA[<p>Howdy.  Nicely done.  Thought I&#8217;d throw my own 2 cents in here.  The following is about the fastest InitialCaps function I&#8217;ve found and it will put a cap after just about anything that isn&#8217;t a letter including special characters.  Heh&#8230; it&#8217;s remarkably simple, too!  The original author (George Mastros) had one heck of an idea on this one!  It even beats a Tally Table solution.</p>
<p>It&#8217;s a shame this forum doesn&#8217;t honor any type of formatting&#8230; the function looks quite nice when properly formatted.  I&#8217;m trying to us non-breaking spaces but, if that doesn&#8217;t work, I&#8217;ll just post it flat&#8230;</p>
<p>CREATE FUNCTION dbo.InitialCap(@String VARCHAR(8000))<br />
/***************************************************************************************************<br />
 Purpose:<br />
 Capitalize any lower case alpha character which follows any non alpha character or single quote.</p>
<p> Revision History:<br />
 Rev 00 &#8211; 24 Feb 2010 &#8211; George Mastros &#8211; Initial concept<br />
 <a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/sql-server-proper-case-function" rel="nofollow">http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/sql-server-proper-case-function</a></p>
<p> Rev 01 &#8211; 25 Sep 2010 &#8211; Jeff Moden<br />
        &#8211; Redaction for personal use and added documentation.<br />
        &#8211; Add no-cap single-quote by single-quote to the filter.<br />
***************************************************************************************************/<br />
RETURNS VARCHAR(8000)<br />
     AS<br />
  BEGIN<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DECLARE @Position INT<br />
;<br />
&#8211;===== Update the first character no matter what and then find the next postionthat we<br />
     &#8212; need to update.  The collation here is essential to making this so simple.<br />
     &#8212; A-z is equivalent to the slower A-Z<br />
 SELECT @String   = STUFF(LOWER(@String),1,1,UPPER(LEFT(@String,1))),<br />
        @Position = PATINDEX(&#8216;%[^A-Za-z''][a-z]%&#8217;,@String COLLATE Latin1_General_Bin)<br />
;<br />
&#8211;===== Do the same thing over and over until we run out of places to capitalize.<br />
     &#8212; Note the reason for the speed here is that ONLY places that need capitalization<br />
     &#8212; are even considered for @Position using the speed of PATINDEX.<br />
  WHILE @Position &gt; 0<br />
 SELECT @String   = STUFF(@String,@Position,2,UPPER(SUBSTRING(@String,@Position,2))),<br />
        @Position = PATINDEX(&#8216;%[^A-Za-z''][a-z]%&#8217;,@String COLLATE Latin1_General_Bin)<br />
;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
 RETURN @String;<br />
    END ;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
