I’m getting error while using replace in an update statement in sql server 2008.
the statement I’m trying to run is :
update table US14-HSS-SQUARE_AISC14-HSS-SQUARE set Designation = replace(Designation,'HSSSQUARE','HSS') where Designation like 'HSSSQUARE%';
want to change ‘HSSSQUARE’ to ‘HSS’ in each row of the column ‘Designation’. e.g.
‘HSSSQUARE16X16X5/8’ to ‘HSS16X16X5/8’.
is there any other syntax in sql server 2008?
You don’t need
tablein the update statement, and you also need to wrap your table name in square brackets if you are going to put illegal characters in it.