>I believe this is correct if that SQLExec creates a new session. Most likely it does. However, if you find this not to be the case, then just add DROP #Temp at the end of the batch to execute. I normally don't drop temp tables in my code and don't remember running into problems.
This is awesome. I have cut another half a second here as I can rely directly from a temporary table, sent in one command, no need to negotiate with a long WHERE IN clause. This is also working very well at SQL Server. I can see that nothing more gets created once each hit is done. So, it seems that each call to execute a command cleans itself after in regards to the temporary table. The only ones that remained in there were those that got created from a query window. I also found that from a query window, for as long as it is opened, the name of the file is something like dbo.#7C66E722____________ and when it is closed, only the first part remains.
>SQL Server handles it itself, so you can re-use the same name.
This is what I found as well.
Thanks