Forum Discussion
Refresh Failure Due to Temp Database Already Existing
- Anonymous1 year ago
We added code to drop the temp table at the start of each source query that we had used temp tables in.
IF OBJECT_ID(N'tempdb..#tTempTableName') IS NOT NULL
BEGIN
DROP TABLE #tTempTableName
ENDAnother solution one of my team mates found was to convert their temp tables to ctes.
This is a work around we implemented but does not adress the core issue.
We added code to drop the temp table at the start of each source query that we had used temp tables in.
IF OBJECT_ID(N'tempdb..#tTempTableName') IS NOT NULL
BEGIN
DROP TABLE #tTempTableName
END
Another solution one of my team mates found was to convert their temp tables to ctes.
This is a work around we implemented but does not adress the core issue.
Unfortunately, dumass Microsoft marks this manual workaround as the solution to their bug and will now never fix it. 😞
And just use DROP TABLE IF EXISITS #tTempTableName