Lynn Pettis (3/20/2013)
Sean Lange (3/20/2013)
Sure this isn't too hard using a tally table.
insert #y
select #x.DocID, t.N
from #x
join tally t on t.N <= #x.pages
select * from #y
You can read about a tally table here. http://www.sqlservercentral.com/articles/T-SQL/62867/[/url]
I'm starting to see a pattern with some of the posts. Looks like people are coming here to get their homework done. Anyone else seeing this?
Yep... I'm thinking the instructor is going to make a mess in his britches when everyone turns in the Tally Table solution. Hopefully, the instructor learns something in the process. 😛
--Jeff Moden
Change is inevitable... Change for the better is not.