[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 675
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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