I have a legacy table with about 100 columns (90% nullable). In those 90 columns I want to remove all empty strings and set them to null. I know I can:
updat
Hammerite's answer is good but you can also replace CASE statements with IFs.
CASE
IF
UPDATE TableName SET column01 = IF(column01 = '', NULL, column01), column02 = IF(column02 = '', NULL, column02), column03 = IF(column03 = '', NULL, column03), ..., column99 = IF(column99 = '', NULL, column99)