GO (SQL Server TSQL)

Signals the end of a batch of SQL statements in Microsoft SQL Server utilities. It is not a Transact-SQL command. Users must follow the rules for batches. For example, any execution of a stored procedure after the first statement in a batch must include the EXECUTE keyword. The scope of local (user-defined) variables is limited to a batch, and cannot be referenced after a GO command.

 

Example

SELECT *
FROM table1
INNER JOIN table2 ON table1.c1 = table2.c1
WHERE table1.c1 > 10
ORDER BY table1.c1

GO