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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Replacing Non-Alphanumeric values

Author  Topic 

rajsqlteam
Starting Member

14 Posts

Posted - 2013-02-28 : 11:48:36
Hello Guys,

I am trying to remove all non alphanumeric characters before displaying it in a column. I am using REPLACE function to remove special characters and replace with none. This is tedious as we have many special characters.
Can somebody suggest me more brief way to replace special characters with nothing?

Thanks in advance.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-28 : 12:01:01
Unfortunately T-SQL string functions have nothing better to offer. If it supported regular expressions, it would be a much easier. So the only alternatives available currently are to either do it the painful way which you are doing, or to use a CLR function (which then can use all the features including the RegEx class in .Net).
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-02-28 : 12:37:31
http://stackoverflow.com/questions/1007697/how-to-strip-all-non-alphabetic-characters-from-string-in-sql-server
Go to Top of Page
   

- Advertisement -