update multiple rows with multiple columns using loop

Hi, colleague,

I have this consultation statement

UPDATE kai
SET `0522` = CASE WHEN` 0522` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0529` = CASE WHEN` 0529` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0605` = CASE WHEN` 0605` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0610` = CASE WHEN '0610` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0610b` = CASE WHEN` 0610b` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0612` = CASE WHEN` 0612` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0619` = CASE WHEN` 0619` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0626` = CASE WHEN '0626` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0703` = CASE WHEN` 0703` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0710` = CASE WHEN` 0710` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0717` = CASE WHEN` 0717` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0724` = CASE WHEN` 0724` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0731` = CASE WHEN` 0731` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0807` = CASE WHEN` 0807` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0808` = CASE WHEN` 0808` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0814` = CASE WHEN` 0814` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0821` = CASE WHEN` 0821` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0828` = CASE WHEN '0828` IS NULL OR & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0902` = CASE WHEN` 0902` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0904` = CASE WHEN` 0904` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0911` = CASE WHEN` 0911` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0918` = CASE WHEN` 0918` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`0925` = CASE WHEN` 0925` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1002` = CASE WHEN` 1002` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1009` = CASE WHEN` 1009` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1016` = CASE WHEN` 1016` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1023` = CASE WHEN` 1023` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1030` = CASE WHEN` 1030` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1106` = CASE WHEN` 1106` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1120` = CASE WHEN` 1120` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1120b` = CASE WHEN` 1120b` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1127` = CASE WHEN` 1127` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1130` = CASE WHEN` 1130` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1130b` = CASE WHEN` 1130b` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1204` = CASE WHEN` 1204` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1211` = CASE WHEN` 1211` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1218` = CASE WHEN` 1218` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1218b` = CASE WHEN` 1218b` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1218c` = CASE WHEN` 1218c` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1218d` = CASE WHEN` 1218d` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1219` = CASE WHEN` 1219` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1219b` = CASE WHEN` 1219b` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1219c` = CASE WHEN` 1219c` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1219d` = CASE WHEN` 1219d` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL,
`1219e` = CASE WHEN` 1219e` IS NULL O & # 39; 0 & # 39; THEN & # 39; & # 39; ANOTHER & # 39; 1 & # 39; FINAL
WHERE empno = & # 39; 0005312004 & # 39 ;;

This was just one of the 5000 rows that I need to update.

How can I use the loop in this without the server disappearing?

I'm trying to update 5000 rows … so basically I'm using a large loop here.

Is there any better way to avoid problems with the server?
SEMrush

Any help would be appreciated.

Thank you