SSMS Tips and Tricks 4-6: Using a count with the GO separator
In T-SQL, a script is a set of one or more batches.
For example, if we have the following script and click Execute, it looks like all the commands were sent to the server and executed all at once:

But that isn’t what happened.
What did happen is that SSMS found the word GO and broke the script into a series of batches. In this case, there were three batches. First, it sent the commands shown here as Batch 1 to the server, waited for them to execute, then sent Batch 2, waited for it to execute, then sent Batch 3, and waited for it to execute.
2025-08-09
