Can you yourself create a scenario where you think that there is no way except a Cursor to achieve the desired o/p.Someone on this forum will surely help you with an equivalent set based approach.Here is one from me.declare @tbl table(col1 int,col2 int)insert into @tblselect 10 ,15;with cteas(select col1,col2,col1 as id from @tblunion allselect t1.col2,t1.col1,cte.id+1 from @tbl t1inner join cte on cte.id+1<=t1.col2)select * from cte
Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH