I am trying to replace all letters in string with "L" and all the number with letter "N" in SQL Server 2014.
I am using following statement:
update my_table
set column2 = replace(column1, 'a', 'L');
update my_table
set column2 = replace(column1, 'b', 'L');
update my_table
set column2 = replace(column1, '1', 'N');
etc. etc.
The problem is, when I execute the query I get that column2 = column1 e.g. abc(column1) = abc(column2)
If I query only one commit e.g. update my_table set column2 = replace(column1, 'a', 'L'); then it works fine, it replaces all A to L.
I tried to excute this query with Sqlite and tested it with smaller database and it works just fine, but i would really need to make this work in mssql.
I would really highly appreciate any support with this question.
I have just started to use SQL Server and I still trying to adopt to changes.
p.s. column2 varchar(64)