<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ASCII &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/ascii/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 09 Aug 2017 18:37:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server: Function to remove Non ASCII Characters and Special Characters</title>
		<link>https://www.dbrnd.com/2017/08/sql-server-function-to-remove-non-ascii-characters-and-special-characters/</link>
					<comments>https://www.dbrnd.com/2017/08/sql-server-function-to-remove-non-ascii-characters-and-special-characters/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 18 Aug 2017 16:16:34 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5884</guid>

					<description><![CDATA[<div><img width="450" height="299" src="https://www.dbrnd.com/wp-content/uploads/2017/08/JunkData.jpg" class="attachment-post-image size-post-image wp-post-image" alt="JunkData" decoding="async" fetchpriority="high" /></div>In this post, I created a function which will remove all non-Ascii characters and special characters from the string of SQL Server. You can use a below function for your existing data and as well as for new data. The solution of removing special characters or non-Ascii characters are always requirement Database Developers. Please check [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="450" height="299" src="https://www.dbrnd.com/wp-content/uploads/2017/08/JunkData.jpg" class="attachment-post-image size-post-image wp-post-image" alt="JunkData" decoding="async" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&amp;linkname=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&amp;linkname=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&amp;linkname=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&amp;linkname=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&amp;linkname=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&amp;linkname=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-function-to-remove-non-ascii-characters-and-special-characters%2F&#038;title=SQL%20Server%3A%20Function%20to%20remove%20Non%20ASCII%20Characters%20and%20Special%20Characters" data-a2a-url="https://www.dbrnd.com/2017/08/sql-server-function-to-remove-non-ascii-characters-and-special-characters/" data-a2a-title="SQL Server: Function to remove Non ASCII Characters and Special Characters"></a></p><p>In this post, I created a function which will remove all non-Ascii characters and special characters from the string of SQL Server. </p>
<p>You can use a below function for your existing data and as well as for new data. The solution of removing special characters or non-Ascii characters are always requirement Database Developers.</p>
<p>Please check the below function and one email example:</p>
<p><strong>Create a function to remove Non-ASCII Chars:</strong></p>
<pre class="crayon-plain-tag">CREATE FUNCTION [dbo].[fn_RemoveNonASCIIChars] 
(
    @Inputstring nvarchar(255)
)
RETURNS nvarchar(255)
AS
BEGIN

    DECLARE @SQL nvarchar(255)
    SET @SQL = ''

    DECLARE @nchar nvarchar(1)
    DECLARE @position int

    SET @position = 1
    WHILE @position &lt;= LEN(@Inputstring)
    BEGIN
        SET @nchar = SUBSTRING(@Inputstring, @position, 1)
        --Unicode &amp; ASCII are the same from 1 to 255.
        --Only Unicode goes beyond 255
        --0 to 31 are non-printable characters
        IF (UNICODE(@nchar) between 192 and 198) or (UNICODE(@nchar) between 225 and 230) 
            SET @nchar = 'a'
        IF (UNICODE(@nchar) between 200 and 203) or (UNICODE(@nchar) between 232 and 235) 
            SET @nchar = 'e'
        IF (UNICODE(@nchar) between 204 and 207) or (UNICODE(@nchar) between 236 and 239) 
            SET @nchar = 'i'
        IF (UNICODE(@nchar) between 210 and 214) or (UNICODE(@nchar) between 242 and 246) or (UNICODE(@nchar)=240) 
            SET @nchar = 'o'
        IF (UNICODE(@nchar) between 217 and 220) or (UNICODE(@nchar) between 249 and 252)  
            SET @nchar = 'u'
        IF (UNICODE(@nchar)=199)  or (UNICODE(@nchar)=231)  -- letter Ç or ç 
            SET @nchar = 'c'
        IF (UNICODE(@nchar)=209)  or (UNICODE(@nchar)=241)  -- letter Ñ or ñ 
            SET @nchar = 'n'
        IF (UNICODE(@nchar) between 45 and 46) or (UNICODE(@nchar) between 48 and 57) or (UNICODE(@nchar)  between 64 and 90) or (UNICODE(@nchar) = 95) or (UNICODE(@nchar)  between 97 and 122)
            SET @SQL = @SQL + @nchar
        SET @position = @position + 1
    END
    SET @SQL = lower(@SQL) -- emails in lower case
    RETURN @SQL

END</pre> </p>
<p><strong>Test the function:</strong></p>
<pre class="crayon-plain-tag">SELECT dbo.fn_RemoveNonASCIIChars('anvesh^&amp;η$%^→&amp;*()*∇+@=gmail.com') AS ValidEmail</pre> </p>
<p><strong>Result:</strong></p>
<pre class="crayon-plain-tag">ValidEmail
------------------
anvesh@gmail.com</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/08/sql-server-function-to-remove-non-ascii-characters-and-special-characters/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
