Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi Experts,Can any one let me know how to replace Number and Special Characters by space.My table has a varchar field (Address) like 1 100 Washington RdE-8 Victory Apparment1 Southwest St #201 How to get rid of the Number and Special Characters, as the data is passed as parameter to SP And also, in full text search is it possible to search a Alpha Numeric field.Thanks
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2009-09-02 : 09:44:27
What is your expected result?MadhivananFailing to plan is Planning to fail
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2009-09-02 : 09:44:46
something like:-
Declare @s varchar(100),@result varchar(100)set @s='1 100 Washington Rd' set @result=''select @result=@result+case when ascii(strval) BETWEEN 65 AND 90 OR ascii(strval) BETWEEN 97 AND 122 then strval else '' end from ( select substring(@s,number,1) as strval from ( select number from master..spt_values where type='p' and number between 1 and len(@s) ) as t ) as t1 SELECT @result