#T-SQL, 61 bytes
T-SQL, 61 bytes
DECLARE @ INT=0L:SET @+=1PRINT @ IF @<(SELECT i FROM t)GOTO L
I used a different technique than Pete Arden's SQL answer. I took my input from column i of pre-existing table t, per our IO standards.
Formatted:
DECLARE @ INT=0
L:
SET @+=1
PRINT @
IF @<(SELECT i FROM t) GOTO L