So now on to the good stuff, why you are all here. Where I work, we add comments to the top of all of our procedures (above the
CREATE) to add notes about changes that were made. Recently we had a procedure that compiled fine, but would not execute. It reported a syntax error, which is odd since it compiled fine:
Read on for the bug, which is a weird one.