<?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/"
		>
<channel>
	<title>Comments on: Sql Server Tips &#8211; Removing or Replacing non-alphanumeric characters in strings</title>
	<atom:link href="http://blog.joggee.com/index.php?feed=rss2&#038;p=52" rel="self" type="application/rss+xml" />
	<link>http://blog.joggee.com/?p=52</link>
	<description>ASP.NET,VB.NET,C#.NET,SQL SERVER,DATABASE,XML,WEBSERVICES,JAVA,SOFTWARE,PROGRAMMING,MANAGEMENT</description>
	<lastBuildDate>Wed, 03 Feb 2010 02:47:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: codeproject</title>
		<link>http://blog.joggee.com/?p=52&#038;cpage=1#comment-24</link>
		<dc:creator>codeproject</dc:creator>
		<pubDate>Fri, 14 Mar 2008 09:34:01 +0000</pubDate>
		<guid isPermaLink="false">http://codeproject.wordpress.com/2007/09/18/sql-server-tips-removing-or-replacing-non-alphanumeric-characters-in-strings/#comment-24</guid>
		<description>Mr. bizarre
It works fine, below is the example code for you.

DECLARE @mycode INT
CREATE TABLE #badcodes(badcode INT)
SET @mycode=33
WHILE @mycode&lt;=255
BEGIN
IF (@mycode BETWEEN 33 AND 47) OR (@mycode BETWEEN

58 AND 64)
OR (@mycode BETWEEN 58 AND 64) OR (@mycode BETWEEN

91 AND 96)
OR (@mycode BETWEEN 123 AND 255)
INSERT INTO #BADCODES VALUES(@mycode)

SET @mycode=@mycode+1
END
GO
-- Suppose you have a @test variable containing bad codes

DECLARE @test VARCHAR(100)
SET @test=&#039;MONTH&#039;
--Below command will replace bad codes with empty string.

UPDATE #badcodes
SET @test=REPLACE(@test,CHAR(badcode),&#039;&#039;)
PRINT @test


DECLARE @test VARCHAR(100)
SET @test=&#039;CLOTH&#039;

--Below command will replace bad codes with empty string.
UPDATE #badcodes
SET @test=REPLACE(@test,CHAR(badcode),&#039;&#039;)
PRINT @test</description>
		<content:encoded><![CDATA[<p>Mr. bizarre<br />
It works fine, below is the example code for you.</p>
<p>DECLARE @mycode INT<br />
CREATE TABLE #badcodes(badcode INT)<br />
SET @mycode=33<br />
WHILE @mycode&lt;=255<br />
BEGIN<br />
IF (@mycode BETWEEN 33 AND 47) OR (@mycode BETWEEN</p>
<p>58 AND 64)<br />
OR (@mycode BETWEEN 58 AND 64) OR (@mycode BETWEEN</p>
<p>91 AND 96)<br />
OR (@mycode BETWEEN 123 AND 255)<br />
INSERT INTO #BADCODES VALUES(@mycode)</p>
<p>SET @mycode=@mycode+1<br />
END<br />
GO<br />
&#8211; Suppose you have a @test variable containing bad codes</p>
<p>DECLARE @test VARCHAR(100)<br />
SET @test=&#8217;MONTH&#8217;<br />
&#8211;Below command will replace bad codes with empty string.</p>
<p>UPDATE #badcodes<br />
SET @test=REPLACE(@test,CHAR(badcode),&#8221;)<br />
PRINT @test</p>
<p>DECLARE @test VARCHAR(100)<br />
SET @test=&#8217;CLOTH&#8217;</p>
<p>&#8211;Below command will replace bad codes with empty string.<br />
UPDATE #badcodes<br />
SET @test=REPLACE(@test,CHAR(badcode),&#8221;)<br />
PRINT @test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chapman</title>
		<link>http://blog.joggee.com/?p=52&#038;cpage=1#comment-25</link>
		<dc:creator>Chapman</dc:creator>
		<pubDate>Thu, 13 Mar 2008 14:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://codeproject.wordpress.com/2007/09/18/sql-server-tips-removing-or-replacing-non-alphanumeric-characters-in-strings/#comment-25</guid>
		<description>your code doesn&#039;t work when the string contains the letters TH together. try CLOTH or MONTH

Bizzare</description>
		<content:encoded><![CDATA[<p>your code doesn&#8217;t work when the string contains the letters TH together. try CLOTH or MONTH</p>
<p>Bizzare</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codeproject</title>
		<link>http://blog.joggee.com/?p=52&#038;cpage=1#comment-23</link>
		<dc:creator>codeproject</dc:creator>
		<pubDate>Sun, 11 Nov 2007 10:39:03 +0000</pubDate>
		<guid isPermaLink="false">http://codeproject.wordpress.com/2007/09/18/sql-server-tips-removing-or-replacing-non-alphanumeric-characters-in-strings/#comment-23</guid>
		<description>I will make it clear to you that first I created a temp table and insert all the special characters in it.

IF (@mycode BETWEEN 33 AND 47) OR (@mycode BETWEEN 58 AND 64)
OR (@mycode BETWEEN 58 AND 64) OR (@mycode BETWEEN 91 AND 96)
OR (@mycode BETWEEN 123 AND 255)

with this condition it will only let special character insert in a temp table.

In replace function I am using CHAR( function this will return Character code of the any alphabetic.

If you have any confusion do write me.

Rana</description>
		<content:encoded><![CDATA[<p>I will make it clear to you that first I created a temp table and insert all the special characters in it.</p>
<p>IF (@mycode BETWEEN 33 AND 47) OR (@mycode BETWEEN 58 AND 64)<br />
OR (@mycode BETWEEN 58 AND 64) OR (@mycode BETWEEN 91 AND 96)<br />
OR (@mycode BETWEEN 123 AND 255)</p>
<p>with this condition it will only let special character insert in a temp table.</p>
<p>In replace function I am using CHAR( function this will return Character code of the any alphabetic.</p>
<p>If you have any confusion do write me.</p>
<p>Rana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JC</title>
		<link>http://blog.joggee.com/?p=52&#038;cpage=1#comment-22</link>
		<dc:creator>JC</dc:creator>
		<pubDate>Sat, 10 Nov 2007 15:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://codeproject.wordpress.com/2007/09/18/sql-server-tips-removing-or-replacing-non-alphanumeric-characters-in-strings/#comment-22</guid>
		<description>Thanks so much - Perfect!  I&#039;m just past the newbie stage of Transact-SQL and still learning.  Can you please explain how the replace &quot;knows&quot; how to look at every badcode row in the table ? That&#039;s a very powerful capability that would not be obvious from the Transact-SQL definition of REPLACE.

-JC</description>
		<content:encoded><![CDATA[<p>Thanks so much &#8211; Perfect!  I&#8217;m just past the newbie stage of Transact-SQL and still learning.  Can you please explain how the replace &#8220;knows&#8221; how to look at every badcode row in the table ? That&#8217;s a very powerful capability that would not be obvious from the Transact-SQL definition of REPLACE.</p>
<p>-JC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijayan</title>
		<link>http://blog.joggee.com/?p=52&#038;cpage=1#comment-21</link>
		<dc:creator>Vijayan</dc:creator>
		<pubDate>Wed, 19 Sep 2007 15:28:33 +0000</pubDate>
		<guid isPermaLink="false">http://codeproject.wordpress.com/2007/09/18/sql-server-tips-removing-or-replacing-non-alphanumeric-characters-in-strings/#comment-21</guid>
		<description>Wonderful. Pls keep me updated with your latest techniques. It really help me with my project.
Good luck. I&#039;m looking forward to your next posting.</description>
		<content:encoded><![CDATA[<p>Wonderful. Pls keep me updated with your latest techniques. It really help me with my project.<br />
Good luck. I&#8217;m looking forward to your next posting.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
