Search This Blog

Monday 2 November 2015

Checking for Existence of a Temporary Table

This is a little problem that drove me nuts!!  If you're working with temporary tables usually you can just reference the table name without including the database name and the SQL engine knows the table is in the temporary database.  I was creating a script which needed to check for the existence of a temporary table and if it does exist delete it - this was to make sure that if the script needed to be run more than once consecutively that not only did it not error but it also ensured that I was only working with the current entries in the temporary table and not any left over from previous script runs.  To see the solution go to the page I have written on this:

Check for existence of a temporary table

No comments:

Post a Comment