|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, March 14, 2013 4:15 AM
Points: 3,240,
Visits: 4,960
|
|
Comments posted to this topic are about the item Trim Non-Alpha characters from string
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sometimes, winning is not an issue but trying. You can check my BLOG here
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, February 04, 2011 7:20 AM
Points: 977,
Visits: 1,499
|
|
Pretty cool.
Tom Garth Vertical Solutions
"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 11:20 AM
Points: 225,
Visits: 984
|
|
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
Kate The Great  If you don't have time to do it right the first time, where will you find time to do it again?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 11:20 AM
Points: 225,
Visits: 984
|
|
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.
Kate The Great  If you don't have time to do it right the first time, where will you find time to do it again?
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, April 03, 2013 6:33 AM
Points: 25,
Visits: 256
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 5:04 PM
Points: 128,
Visits: 315
|
|
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.
DECLARE @data VARCHAR(100) SET @data = '!2131231Atif123123 234234Sheikh6546' WHILE PATINDEX('%[^a-z ]%', @data) > 0 SET @data = STUFF(@data, PATINDEX('%[^a-z ]%', @data), 1, '') SELECT RTRIM(LTRIM(@data)) AS Data
Thanks again!
Adam Sottosanti
|
|
|
|