Insert symbols into existing cells

I need to update a group of cells by inserting all the same two characters into them, but I'm just drawing a space on how to do this. Can anyone point me in the right direction?

Old cells
HI.1
HI.2
HII.1

New cells
H08I.1
H08I.2
H08II.1

+1


source to share


2 answers


UPDATE Cells SET Cell = LEFT(Cell, 1) + '08' + SUBSTRING(Cell, 1, LEN(Cell)-1)

      



+5


source


If all your cells look like this:

update cells
set cell = Replace(cell,'H','H08');

      



(But note that Replace doesn't care where the "H" appears).

Note. I'm assuming we're talking about SQL and tables here - maybe "cell" is something else?

+2


source







All Articles