There’s More To GO Than Meets The Eye

This little tidbit originated with Kalen Delaney, and was forwarded to me by Lance Larsen, a colleague here at Microsoft.  I’ve verified that this works in all versions of SQL Server since SQL Server 2000 SP4.

Here’s Lance’s note:

I did not know about this feature until yesterday…could make inserting test data easier.


PRINT ‘hello world’

go 5




Beginning execution loop

hello world

hello world

hello world

hello world

hello world

Batch execution completed 5 times.

Pretty slick, eh?

I hope this tip comes in handy; thanks to Lance for passing it along (and to Kalen for finding it!).


Comments (2)

  1. Anonymous says:

    Exactly, Greg..  most of these techniques can strike one as highly esoteric, until one needs them. 🙂

  2. Greg Lucas says:

    My initial thought was what a brilliant but useless tidbit.  But then again when I started really  thinking about how useful this might be – for soak testing for example.