Re: Temp Table Problem
From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 11/27/03
- Previous message: Brian Bushay TeamB: "Re: data not write to disk immediately when TableDirect is False"
- In reply to: D Whaley: "Temp Table Problem"
- Next in thread: D Whaley: "Re: Temp Table Problem"
- Reply: D Whaley: "Re: Temp Table Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 26 Nov 2003 19:46:37 -0600
>I have a query that creates a temp table on SQL Server 2K. The code resides
>in a DLL.
>Other queries then use this temp table.
>
>This was actually a unit in a working program that was converted to a DLL.
>Problem is, now in the DLL, the temp table will not persist. When I try to
>use it in other queries, it is gone. Wierd thing is, If I compile the DLL
>into the directory where the source resides, then it works (When running
>from D7 IDE). If I compile it to a different directory, then it doesn't
>work.
>
>I have tried using Client and Server side cursors, niether works.
SQL server has two kinds of temporary tables. Tables that start with # are
local temporary tables visible only to the connection that creates them. The
are deleted when the connection is closed.
Table that start with ## are global temporary tables are available to any
connection are deleted after all open connections using them are closed.
If you are using the local Temporary tables there are a problems when you have
the Adoconnection is set up to use connection Pooling. When you do this every
time you execute a query you use a new connection and loose the ability to
reconnect to temporary tables created in another connection.
If you are using the Global temporary tables then the way you are using the Dll
is closing the connection and the temporary table is being deleted because it is
no longer being used.
-- Brian Bushay (TeamB) Bbushay@NMPLS.com
- Previous message: Brian Bushay TeamB: "Re: data not write to disk immediately when TableDirect is False"
- In reply to: D Whaley: "Temp Table Problem"
- Next in thread: D Whaley: "Re: Temp Table Problem"
- Reply: D Whaley: "Re: Temp Table Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|