Search notes:

SQL Server: go

go is neither an SQL nor a T-SQL statement. - go is the default SQL batch terminator in sqlcmd, osql or in Management Studio.
When one of these tools recognize a go, they send the current batch of SQL and T-SQL statements to the SQL Server for execution.
In sqlcmd, the batch terminator can be changed with the -c option.
The scope of variables ends with a go.

No effect on transactions

The following snippet demonstrates that go has no effect on transactions.
create table tq84_go_trx(
  id  integer    identity,
  txt varchar(20)
);

go

insert into tq84_go_trx (txt) values ('Insert 1')

begin transaction

insert into tq84_go_trx (txt) values ('Insert 2')

--
-- A go does not commit the current transaction...
--
go

--
-- ... therefore, the following rollback rolls back the insertion
-- of 'Insert 2' into tq84_go_trx.
--
rollback

--
-- Only 'Insert 1' is selected:
--
select txt from tq84_go_trx order by id;
Github repository about-MSSQL, path: /sql/go/transaction.sql

Executing a batch multiple times

go can be used with an optional number that specifies how often a batch should be executed:
print 'this is printed 10 times';
go 10

Index