sestell1 (3/19/2013)
CapnHector (3/18/2013)
I always use a close parentheses ")" at the top of my code sheets (be careful if you add a go it may not work exactly, tend not to break any thing into batches except in roll out scripts.) This generates a parse error and stops the batch from running.Simple and effective, I like it!
That or SELECT * FROM FakeTable will only stop single batch from executing if your script has multiple batches (separated by GO), only the one will be terminated by having such "parse" errors, other batches will not be affected.
If you want to terminate your script for sure use high severity error:
RAISERROR ('Stop here',20,1) WITH LOG
Nothing will pass the above;-)