﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Atif Sheikh  / Trim Non-Alpha characters from string / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 06:07:45 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Trim Non-Alpha characters from string</title><link>http://www.sqlservercentral.com/Forums/Topic955294-2702-1.aspx</link><description>Thanks for the script, I like they way you created the tally table on the fly lilke that, I never thought of doing that!   Here is what I've been using to do the same thing, it's pretty easy to modify to include/exclude numerics, spaces, certain special characters etc... which is why I like it.  [code="sql"]DECLARE @data VARCHAR(100)SET @data = '!2131231Atif123123 234234Sheikh6546'WHILE PATINDEX('%[^a-z ]%', @data) &amp;gt; 0       SET @data = STUFF(@data, PATINDEX('%[^a-z ]%', @data), 1, '') SELECT    RTRIM(LTRIM(@data)) AS Data[/code]Thanks again!</description><pubDate>Thu, 27 Jan 2011 09:12:10 GMT</pubDate><dc:creator>Adam Sottosanti</dc:creator></item><item><title>RE: Trim Non-Alpha characters from string</title><link>http://www.sqlservercentral.com/Forums/Topic955294-2702-1.aspx</link><description>Thank you for this example. If you do much data cleansing or string manipulation, keep in mind that you can implement regular expression functionality in SQL Server 2005 and above. It's easier than I thought it would be, assuming your DBA allows you to enable CLR integration.This article lays it out very well:[url]http://justgeeks.blogspot.com/2008/08/adding-regular-expressions-regex-to-sql.html[/url]</description><pubDate>Tue, 20 Jul 2010 09:36:18 GMT</pubDate><dc:creator>James Zimmerman</dc:creator></item><item><title>RE: Trim Non-Alpha characters from string</title><link>http://www.sqlservercentral.com/Forums/Topic955294-2702-1.aspx</link><description>I did get an error applying to a nullable column. (LEN=0; Error was "TOP clause contains an invalid value.") Because I'm in a hurry I just threw a case statement around the function call but a clause in the function to work around that would be a nice enhancement.</description><pubDate>Tue, 20 Jul 2010 08:22:50 GMT</pubDate><dc:creator>katedgrt</dc:creator></item><item><title>RE: Trim Non-Alpha characters from string</title><link>http://www.sqlservercentral.com/Forums/Topic955294-2702-1.aspx</link><description>Very nice.  Just so happens I was bemoaning having to write a 'strip non-numeric characters' function today.  You probably saved me an hour!  :D</description><pubDate>Tue, 20 Jul 2010 08:12:37 GMT</pubDate><dc:creator>katedgrt</dc:creator></item><item><title>RE: Trim Non-Alpha characters from string</title><link>http://www.sqlservercentral.com/Forums/Topic955294-2702-1.aspx</link><description>Pretty cool.</description><pubDate>Tue, 20 Jul 2010 07:47:58 GMT</pubDate><dc:creator>Tom Garth</dc:creator></item><item><title>Trim Non-Alpha characters from string</title><link>http://www.sqlservercentral.com/Forums/Topic955294-2702-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/String+Manipulation/70558/"&gt;Trim Non-Alpha characters from string&lt;/A&gt;[/B]</description><pubDate>Mon, 19 Jul 2010 23:32:52 GMT</pubDate><dc:creator>Atif-ullah Sheikh</dc:creator></item></channel></rss>