Fixed a few syntax problems. I'm not convinced the set based approach is so good here because an error with one table causes all ALTERs and UPDATEs to fail. Possibly better to do this using a cursor where individual failures won't stop the rest of the alterations from running.