If you have a couple of these suckers, and they are decently complex, the temp table is not a bad idea.
On this, I think we shall have to agree to disagree.
Global temporary tables are automatically dropped when the session that created the table ends and all other tasks have stopped referencing them. The association between a task and a table is maintained only for the life of a single Transact-SQL statement. This means that a global temporary table is dropped at the completion of the last Transact-SQL statement that was actively referencing the table when the creating session ended.
If this stuff is worth storing in a table and is going to be referenced by multiple scripts or procs, it should be held in a permanent table, not one which may disappear unexpectedly.
Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this
If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.