At the start of ETL package the following SQL query runs against a SQL Server 2012 database:
IF OBJECT_ID(N'tempdb..##SlotChanges') IS NOT NULL
BEGIN
DROP TABLE ##SlotChanges
END
CREATE TABLE ##SlotChanges
(
--Snip
)
The package then writes some rows to the temp table and uses it as the final data source when writing to the destination database.
There is no drop command at the end, as it will only be checked at the beginning of the next run, but if I then open SSMS and run a select against the table it returns an invalid object exception. I can query the table through SSMS just fine while the package is running, but as soon as it finishes the table's gone.
My understanding is that a global temp table should persist even though the package's session has been lost. I'm wondering if anybody knows what's causing the temp table to drop / fall out of scope after the package completes.