Thank this author by sharing:
By Keith Wiggans,
This script can be used to fill a primary key column quickly without using a traditional loop or cursor. The interesting part is the "GO n" section which will repeat code within the batch "n" number of times. Be sure to create the TinyTally table first.
As a member of SQLServerCentral, you get free access to loads of fresh content: thousands
of articles and SQL scripts, a library of free eBooks, a weekly database news roundup,
a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals
that makes it such a success.