Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

Compilation

A batch is a group of one or more Transact-SQL statements compiled as a single unit. A stored procedure is an example of a batch. Another example is a set of statements in the Query window in the SQL Pane in SSMS. The GO command divides sets of statements into separate batches. Observe that GO is not a T-SQL statement. SQLCMD, OSQL, and SSMS use the keyword GO to signal the end of a batch.

SQL Server compiles the statements of a batch into a single executable unit called an execution plan. During compilation, the compiler expands the statements by including the relevant constraints, triggers, and cascading actions that have to be carried out during the statement execution. If the compiled batch contains invocations of other stored procedures ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.