When running a sql script with multiple statements, execution stops at the first one, or the second one is "not aware" of the first one.
Quick example:
DECLARE @abc VARCHAR(10) = 'test'; SELECT @abc;
returns:
Must declare the scalar variable "@abc".
It does also "misbehave" in the interface, with the connection information showing between lines.

If we add several blank lines to the start, and the example script mentioned above is in line 5, for instance, it stops throwing the error, but instead simply returns:
Success, 1 row affected