Ha! Found it. That had me stumped for some minutes.
You're missing an END. There's a BEGIN on line 7, but no matching end. Put the END after the last EXEC and the syntax check goes through fine
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability