insert data at the start in a field already created in sql

0

can help me by indicating how the data update is done at the beginning of a field already created in SQL, for example:

telefono 323890988 247639087

For the fields of the telephone table I need to add at the beginning of each of them the value 012, remaining:

012323890988 012247639087

Keep in mind that there are millions of data to update.

Thank you very much.

    
asked by PABLO ALVAREZ 31.05.2018 в 03:25
source

1 answer

2
UPDATE tabla SET [columna] = '012' + RTRIM([columna])

We use the chain concatenation operator to add the value "012" to the beginning of the chain and RTRIM to get the value of the string without spaces.

Do not forget to use a WHERE if it applies

    
answered by 31.05.2018 в 03:50