Solved

Removing special characters from column

Posted on 2011-03-04
4
408 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS SQL export CSV & schedule It 9 44
Help with SQL Query 23 39
SQL JOIN 6 39
Square brackets 4 0
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now