I have one table which name is emp in this table one colomn which name is empname, there are more then 2000 employees , in this coloumn some names are like ' Avinash K. Odedra' it should be like 'Avinash K Odedra' , Now i wants to remove this special characters from it, Pls. Suggest me SQL Query for same.
Asked
Active
Viewed 74 times
3 Answers
0
This is not a particularly well formed question..
A quick google, with the words 'SQL Replace Special Characters', provided this similar question.
Looks like it might do what you need.
0
Please try the code below:
update emp
set empname = REPLACE(empname,"'","")

Ethic Or Logics
- 111
- 1
- 13
0
pls search your doubts before posting a question
removes special characters
DECLARE @str VARCHAR(400)
DECLARE @expres VARCHAR(50) = '%[~,@,#,$,%,&,*,(,),.,!]%'
SET @str = '(remove) ~special~ *characters. 3 5 from string 1 in sql!'
WHILE PATINDEX( @expres, @str ) > 0
SET @str = Replace(REPLACE( @str, SUBSTRING( @str, PATINDEX( @expres, @str ), 1 ),''),'-',' ')
SELECT @str

Ronser
- 1,855
- 6
- 20
- 38