Here's another possibility:
declare @t1 table (Id int)
insert into @t1 (Id)
select 1 union
select 2 union
select 3
declare @t2 table (Id int, X int)
insert into @t2 (Id, X)
select 1, 10 union
select 2, 5 union
select 3, 0;
with t3 as (
select id, x, row_number() over (partition by id order by id) ro from @t2
cross join sys.all_columns
)
select id, x from t3 where ro <= x
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.