Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi there,I have a column with value like 85jdf-84-ii or 4-35-uf-r4What I need to do is remove the "-", so they would become:85jdf84ii or 435ufr4Does anyone know how to do this?Thanks!
Pat Phelan
Posting Yak Master
187 Posts
Posted - 2004-09-11 : 09:34:45
I'd use:
SELECT Replace(Replace(myColumn, '-', ''), '-', '') FROM myTable
-PatP
raisor
Starting Member
28 Posts
Posted - 2004-09-11 : 09:43:59
ow......that simple eh :DTHANKS!
nr
SQLTeam MVY
12543 Posts
Posted - 2004-09-11 : 11:00:00
even simpler - only needs one replace.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.