SQLServer随机填充,求大神解答

table1:id,p_name;
table2:id,s_name,p_name;
table1中有十条记录,我现在想将table1中10条记录的P_name随机填入table2中的p_name,不可重复,table2共有70条记录,随机填就可以,10条都填入,剩下的位置可以为空
如果我后续还要加入随机分配时的约束条件,又如何去加?

update table2 a
join (
select b.id,a.p_name
from (select a.*,row_number() over (order by rand()) as rn from table1 a) a
join (select b.*,row_number() over (order by rand()) as rn from table2 b) b
on a.rn = b.rn
) b
on a.id = b.id
set a.p_name = b.p_name