• here's one way. Not necessarily the most efficient, but it's not bad.

    drop table #matt

    declare @rows_needed int

    declare @length_needed int

    select @rows_needed=1000,

    @length_needed=64

    select top(@rows_needed*@length_needed)

    identity(int,1,1) RN

    ,cast(N as int) N

    ,0 as batchcol

    ,'' as randchar

    into #matt

    from tally

    order by newid()

    update #matt

    set batchcol = cast(rn/@length_needed as int),

    randchar = char(n%52+65)

    create index m on #matt(batchcol) include(randchar)

    select distinct batchcol,

    (select

    randchar as 'text()'

    from

    #matt m_in

    where m_in.batchcol=m_out.batchcol

    for xml path ('')) from #matt m_out

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?