Temporary Table already exists 
Author Message
 Temporary Table already exists

Error Message: There is already an object named '#rsTmp'
in the database.

My code checks for any active connections as one of the
first steps and closes them.  So why would it still be
there?

Code:

TmpSelect = "Select Mast.fsono, Item.fline Into #rsTmp
From Mast, Item Where Upper(Mast.fSono) Between '001408'
AND '001408' AND Upper(Mast.fSono) = Upper
(SoItem.finumber)"

With cmdTmp
    .ActiveConnection = cnClient  'Client-side connection
    .CommandText = TmpSelect
    .CommandType = adCmdText
    .Execute
End With



Fri, 04 Jun 2004 05:38:25 GMT
 Temporary Table already exists

Could be you're reusing a pooled connection.  You could try adding SQL to
check for the existence of the temp table and drop it if it shows up before
the select ... into, like this:

TmpSelect = "if object_id('tempdb..#rsTmp') is not null drop table
#temptable Select Mast.fsono, Item.fline Into #rsTmp... "

--
Bob
Microsoft Consulting Services
------
This posting is provided AS IS with no warranties, and confers no rights.



Fri, 04 Jun 2004 10:46:04 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Err: Temporary table object already in database.

2. add new table unless already exists

3. How to find out if a table already exists with PL/SQL

4. Adding PRIMARY KEY to already existing table's field

5. How to check if a table already exists

6. How to check if an tempory table already exists

7. check if table already exists??

8. an already existing alter table drop column ?!?!?!

9. table already exists error

10. table already exists ???

11. Checking if a #temp1 table exists already

12. Add a new Database field to a already-existing Paradox table at RUNTIME


 
Powered by phpBB® Forum Software