SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Replacing Non-Alphanumeric values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rajsqlteam
Starting Member

14 Posts

Posted - 02/28/2013 :  11:48:36  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3712 Posts

Posted - 02/28/2013 :  12:01:01  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 02/28/2013 :  12:37:31  Show Profile  Reply with Quote
http://stackoverflow.com/questions/1007697/how-to-strip-all-non-alphabetic-characters-from-string-in-sql-server
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000