March 20, 2008 at 11:30 am
HI
I have a field called JobRole where in i found few records misspelled like DBA, Adminitrator, NIIT
the right way is DBA ADministrator NIIT
I need to find out records like this and get rid of comma's in between.
thanks
March 20, 2008 at 11:43 am
I think this shud work
Update authors
Setcity = replace(city, 'Salt', 'Olympic')
March 20, 2008 at 11:46 am
It tough to exactly give you the right code, but you could do something like this:
Code to view the results in question:
SELECT MyColumn = REPLACE(MyColumn,',','')
FROM MyTable
WHERE CHARINDEX(',',MyColumn) > 0
The code to resolve the issue:
UPDATE MyTable
SET MyColumn = REPLACE(MyColumn,',','')
WHERE CHARINDEX(',',MyColumn) > 0
You should be aware that the above code will replace all commas in the string with a blank space. You should run the code as a select first to make sure that it is producing the correct results.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply