Just a day ago, I received interesting question on this blog. Read original question here. This is very good question and after reading this question I quickly wrote small script as answer. Let us see the question and answer together.
Q. How can we generate incremented linear number in sql server as in oracle we generate in via sequence?
A. Run following script which will generate output in sequence, which will generate output as you requested.
DECLARE @idt INT SET @idt = 0 WHILE (@idt < 100) BEGIN SELECT @idt = @idt + 1 PRINT @idt END
Reference : Pinal Dave (https://blog.sqlauthority.com)