declare @count int
set @count = 0
while (@count < 10000)
begin
print RIGHT('0000' + CAST(@count AS VARCHAR), 4)
set @count = @count +1
end

相关文章: