Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dropping Temp Tables in Stored Procs

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-02 : 16:51:22
Brian writes "How do I first determine the existence of a temp table then drop it?

I have tried the following:

IF EXISTS(SELECT 1
FROM #tempAgencyList)
DROP TABLE #tempAgencyList

Create Table #tempAgencyList(
agencyID int null
)

But it never gets to the Drop statement."
   

- Advertisement -