declare @i int declare @stri varchar(max) set @i=0 while @i<10 begin set @i = @i+1 set @stri=CONVERT(varchar(100),@i) print @stri end