• The issue is, you are specifying the GO batch separator so if you encounter an error in one batch, the subsequent batches will still execute.

    If you encounter an error you can try raising an error with severity 20. This will end the current connection completely, preventing subsequent batches from running. You must specify the WITH LOG option at the end...

    RAISERROR('Script Failed!', 20, 1) WITH LOG

    See how that works for you.

    John