Processing Transactions in Batches

You can submit SQL statements to SQL Server one at a time, entering statements and receiving results interactively. Or you can submit multiple SQL statements as a batch, interactively or in a file.

A batch of SQL statements is terminated by an end-of-batch signal that instructs SQL Server to go ahead and execute the statements. The end-of-batch signal used here¾for the stand-alone isql utility¾ is the GO statement on a line by itself.

Technically speaking, a single SQL statement can constitute a batch, but it is more common to think of a batch as containing multiple SQL statements. Frequently, a batch of statements is written to a file before being submitted to isql. The file can contain multiple batches, each separated by the GO statement.

For details on batches, see Batches in the Microsoft SQL Server Transact-SQL Reference.