Broke apart the metadata insert statements from the messages insert statements so the sql would be syntactically correct (aligned tests with code).