Hey Patrick -
Just curious why you couldn't use a table variable rather than a temp table?
Also, from a performance perspective - read/write procedures may result in limited parallelization.
Just a few thoughts as you moved forward with your result.
Cheers,
Jody