May 26, 2014 at 11:46 am
Hello,
We have a table with roughly 5k reocrds, 3 columns which are Id, ChildDescription, ChildValue
ChildValue has values like the following
bracket-clocks
clock-parts
cuckoo-clocks
I need a script which will go through all of the child values and replace the - with _ so the end result would look like
bracket_clocks
clock_parts
cuckoo_clocks
I'm not a DBA I have minimal experience with SQL due to being a front end developer so any help would be appreciated.
May 26, 2014 at 11:55 am
Have you tried pressing F1 and looking for REPLACE? You should get to this nice article:
http://msdn.microsoft.com/en-us/library/ms186862(v=sql.110).aspx
May 27, 2014 at 7:39 am
update tblname set ChildValue = replace(ChildValue ,'-','_')
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply