Here ya go. This code has some provisions in it for a min, max, and a list of exceptions that I wanted to leave out of my table. You should be able to do some quick modifications to this and make it work for ya.Create Table TallyTable( Tally int)SET NOCOUNT ONDeclare @i intSet @i = 101WHILE @i <= 9998 BEGIN SELECT @i = CASE WHEN @I in (2222,3333,4444,5555,6666,7777,8888) THEN @i + 1 ELSE @i END Insert Into TallyTable Values (@i) Set @i = @i + 1 ENDSET NOCOUNT OFF
Michael<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>