Convert all uppercase to lowercase on SQL server?

I want to update every row in my table from upper case to lower case. I searched everywhere, but did not find a suitable answer. I do not want it to select with SELECT . I would like to constantly change, can use ALTER . I am using SQL Server 2008. Thank you.

+8
source share
4 answers
 UPDATE table_name SET col1 = LOWER(col1), col2 = LOWER(col2), col3 = LOWER(col3); 

NTN

Edit: update multiple columns. Just keep adding columns as above. There is no direct automated way to update all columns with a single command. Well, technically this is possible with cursors , but I would recommend it, since it looks like a one-time process, and you better write the command once and for all.

+21
source

Here is the LOWER function. You need to UPDATE table:

 UPDATE mytable SET charfld1=LOWER(charfld1), charfld2=LOWER(charfld2), ... 

Put all your text fields after SET .

+2
source

You can do this using string functions:

 UPDATE MyTable SET MyColumn = LOWER(MyColumn) 
0
source

testhjjgh jghjghj jghjghj jgjg hjghj ghj ghj

-3
source

Source: https://habr.com/ru/post/975974/


All Articles