• You can also use sp_execsql for this.

    You can also consider the option to run a single query that will update all rows in a single pass (assuming it's possible).