with cteRandomsas(select top 10000 abs(checksum(NewId()))%600 as Random , ROW_NUMBER() over (order by (select null)) as RowN from syscolumns a cross join syscolumns b),ctefilteras(select * ,row_number() over (partition by Random order by RowN ) Rowfilter from cteRandoms)select top 300 Random from ctefilter where Rowfilter < 3order by RowN
select Random from numbers cross apply GetVariableLengthRandomCode(ISNULL(8,num),16,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')