Solved

Removing special characters from column

Posted on 2011-03-04
4
411 Views
Last Modified: 2012-05-11
How would I remove special charaters (/) from my fname column. the position of these characters are not predictable. I would like to have Space instead of this character in my table.
the records are somthing like this
'X/YZ'
'AB/C'
Please suggest.
0
Comment
Question by:parpaa
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Cluskitt
ID: 35035453
UPDATE table
SET fname=REPLACE(fname,"/","")
WHERE fname LIKE '%/%'
0
 
LVL 18

Accepted Solution

by:
Cluskitt earned 125 total points
ID: 35035461
Or you can even drop the where part. It will simply update all records, regardless of having a / or not. When it doesn't, it updates to the same value, though.
0
 
LVL 22

Expert Comment

by:Thomasian
ID: 35035637
SELECT REPLACE(fname, '/', ' ') FROM tablename

Open in new window


OR to replace the values permanently:

UPDATE tablename SET fname = REPLACE(fname, '/', ' ') WHERE fname LIKE '%/%'

Open in new window

0
 

Author Closing Comment

by:parpaa
ID: 35041720
Thanks very much
It worked perfectly
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question