I have some code I've written that creates a number of temp tables, and I'm trying to check that the temp tables don't exist before I create them.
Currently, the code uses SqlConnection.GetSchema
to look for the tables, but that doesn't seem to return temp tables.
Does anyone know of a clean way I can do this, apart from querying tempdb
or trying to query the table and looking for exceptions?