Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 673
  • Last Modified:

SQL Script to remove specific character from a column

I need to remove a "-" from data in a table column. It's a chart number where they have three didgits followed by a dash and then two more digits. There are thousands of them so doing it one by one would be very time consuming. Hoping a scipt would be possible. Table = Patient, Colunm = Chart. Any help would be greatly appreciated. Thanks in Advance.
0
wdabbs
Asked:
wdabbs
  • 2
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
update Patient
set Chart = replace('-','',Chart )
where chart like '%-%'
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
simple UPDATE:
UPDATE Patient
   SET Chart = REPLACE(Chart, '-', '')
 WHERE Chart LIKE '%-%'

Open in new window

0
 
Aneesh RetnakaranDatabase AdministratorCommented:
update Patient
set Chart = replace(Chart ,'-','')
where chart like '%-%'
0
 
wdabbsAuthor Commented:
Awesome... simply awesome.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now