>I don't understand why you "lost" temporary table.
>I use tow ways:
>1) dynamic SQL with EXECUTE
>2) OLE-DB
This page explains it all :
https://www.sommarskog.se/dynamic_sql.htmlThe section "Temp Tables and Dynamic SQL" is exactly the situation.
Have you found a way to use such approach without having to create the temporary table before so it would be in the scope?
OpenRowSet() has to be used because we have to import some Excel data.