Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

substitutions within string fields

Status
Not open for further replies.

samoff

Programmer
Aug 16, 2000
15
GB
I'd like to replace any non-alphanumeric characters in a text field with spaces.
eg. "rt/sm-01" becomes "rt sm 01" etc.

Any ideas?

sam

http:
 
The only immediate idea that comes to mind is a series of REPLACE() statements; cumbersome, and probably not very efficient (read: slow), but fairly easy and straightforward to code.

A second thought, one that is more flexible and easier to maintain: have a table dedicated to storing the "bad" characters, then have an SP that uses that table as a driver for the UPDATE...REPLACE statements.

Robert Bradley

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top