SQL Server “GO n” Batch Separator Tip

Did you know you can specify an integer following GO and the client tools will submit the batch the specified number of times? For example:

PRINT ‘GO’
GO 3

returns:

Beginning execution loop
GO
GO
GO
Batch execution completed 3 times.

Useful for, among other things, quickly generating test data.

Comments are closed.