sql - Update second digit in a column -
how update second digit in 16 digit number '1' ?
this should easy one, have not had luck.
i working sql server 2000 , 2005 (multiple environments - same database tables).
i searched solutions online , found 1 apparently work in oracle, sql server not pipe symbols when run this:
update interface set optionbits = substring(optionbits,1,1)|| replace(substring(optionbits,2,1), '0', '1')||substring(optionbits,3, 14) objectnumber = 5
i want update 1 there object number = 5 can see.
i looked using replace
not solution either.
what trick?
thanks in advance!
for mssql, the stuff
function best option:
update interface set optionbits = stuff(optionbits, 2, 1, '1') objectnumber = 5
Comments
Post a Comment