Analyzing the problem, cause, and resolution for the Invalid Syntax error when running an upgrade on a database with custom database objects.
When applying a UDP as part of an upgrade for a database that contains custom database objects, the process will halt with an invalid syntax error if any of those custom database objects have names that contain a special character.
Fundamentally, this issue is caused by missing '[ ]' around object names that the upgrade process reads from the data dictionary. Therefore, even if you are able to create an object with or rename an existing object to a name that contains an illegal character using '[ ]', the database upgrade process can fail.
The error message will contain the name of the DB object, which you can use to find the object in SSMS. Once you have access to the object, change its name to one that does not contain an illegal character. Once the upgrade is complete, you can return to SSMS and change the name back to its original form to minimize impact.
You should now have a comprehensive understanding of the problem, cause, and resolution for the invalid syntax database update error.