I know that in SQL Server GO is considered a batch separator.
My question is: What is the point of having a batch separator? What benef
In the example there it is of no use whatsoever.
Lots of statements must be the only ones in the batch however.
Such as CREATE PROCEDURE.
Also often after making schema changes (e.g. adding a new column to an existing table) statements using the new schema must be compiled separately in a different batch.
Generally an alternative to submitting separate batches separated by GO is to execute the SQL in a child batch using EXEC