Generating and accessing data of a fixed column layout is easy. You can create local temp tables up-front, and populate them by calling stored proc
Create the temp table before the sp_executesql
: it will still be in scope for "inner" scopes like the sp_executesql
Change the SQL to do an INSERT
rather than SELECT..INTO...
Edit:
Make the table wide enough to cover all options.
Frankly, SQL is designed to work with fixed table definitions: variable output signatures (tables) leads to the problem you have...