Sunday 13 August 2017

Print ‘N’ numbers using Sql Server


By using Common Type Expression(CTE) We can print 


  ;with cte
  as
  (
  select 1 [sequence]
  union all
  select [sequence]+1 from cte where [sequence]<100
  )

  select * from cte

No comments:

Post a Comment