Quickly Create a Table of Numbers

6 03 2007

Easily create a table with a seres of integers for joining to. This is often useful when needing a mutex table.

set nocount on
create table Numbers (ID int identity(1,1))
insert Numbers default values
while scope_identity() < 1000 insert Numbers default values

Actions

Information

Leave a comment