Your technology certification is waiting. Enroll in Cloud Class ®
create table #temp(id int)
;with cte0 as (select 1 as id union all select 1),
cte1 as (select 1 as id from cte0 a, cte0 b),
cte2 as (select 1 as id from cte1 a, cte1 b),
cte3 as (select 1 as id from cte2 a, cte2 b),
cte4 as (select 1 as id from cte2 a, cte3 b),
nums as (select row_number() over (order by id) as id from cte4)
insert into #temp
select * from nums where id between 1000 and 2000
select * from #temp
drop table #temp
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.