As you talk of SQL Server: In any place you do a query you can also call a table valued function (user defined) and can do as much commands as needed to create the reulting data.
If you talk of foxpro reports, there even is less need to create the report driving data in one query.
I can also imagine you just post some test or exam question testing your knowlegde about T-SQL functionality enabling such query results.
Even takeing all that aside, you don't even specify what records you want generated. It would make sense to have meta data including a number of records eg for creating a number of identical labels, but what would not make any sense at all is, to multiply this meta data itself. Because then what do you end up with? The first record having some count field with 5, then creating 5 records each with a count of 5 (as you also copy that), and in the next step processing the 5 new records generating 5x5 further records? Where should that end? What would be the use of this?
I'd suggest you tell us the real world problem of what kind of report you want, and then we don't solve the step you're stuck with, but show you a completely new and hasssle free way to do this.
Bye, Olaf.