0
Well, I have a solution, but I still think the requirements are ridiculous. This assumes that the source table (in my case, @t) has at least one row. If you have zero rows, what exactly are you demoing?
DECLARE @count INT = 17; -- here is whatever your 'X' is
DECLARE @t TABLE(i INT);
INSERT @...