[dba-SQLServer] Error Trapping and temp tables

Mark L. Breen subs1847 at solution-providers.ie
Mon May 31 02:56:56 CDT 2004


Hello All,

I am developing a db and intend to use a temp table. Before use I create it and after use I drop it.

However, because I fear it may somehow remain in the system, I would prefer to do a 

If exists (table name) drop table name

But it is not that easy with temp tables, as you know, so I was considering using a vb function that attempts to drop the table, I can catch the error in vb, I hope, and ignore it.

Have you guys any better suggestions how to do this.

Basically, I want to check for the existence of a temp table and drop it if it exists.

Thanks in advance,

Mark



More information about the dba-SQLServer mailing list