Re: When will global temp table not be dropped after connection is

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



It's easier to simply create a permanent table.


"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D11629A9-3AF3-4E11-ABDD-76F2545C1C60@xxxxxxxxxxxxxxxx
Hi Andrew,

Thanks for the reply. The global temp table is used for some special
purpose. How can I find out whether anything is still accessing that global
temp table? Does connection pooling or related settings have any effect on
the duration of the global temp table?


"Andrew J. Kelly" wrote:

Global temp tables are destroyed after the last user or connection is
finished with them. So if that connection is the only one accessing the
table at the time the connection is lost it will be destroyed. But global
temp tables are almost always a bad idea anyway. If you need persistence use
a real table instead.

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:690FD37C-2E80-4F14-A0EB-500A5498D96A@xxxxxxxxxxxxxxxx
> Is there any SQL Server 2005 Express setting or ODBC setting that will
> cause
> global temp table not be dropped after the connection created it is > lost?



--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________



.



Relevant Pages

  • Re: VB with SQL Server... Unable to create temp table using ADO connection object
    ... The trace shows that spid 59 disconnects immediately after the global temp ... connection assuming it is not actively being used on a different connection. ... "Peri" wrote in message ...
    (microsoft.public.sqlserver.programming)
  • Re: When will global temp table not be dropped after connection is
    ... I don't know if there is a way to tell who is using the table or not and I do not believe connection pooling has any effect. ... Andrew J. Kelly SQL MVP ... The global temp table is used for some special ...
    (microsoft.public.sqlserver.connect)
  • Re: When will global temp table not be dropped after connection is los
    ... Global temp tables are destroyed after the last user or connection is finished with them. ... So if that connection is the only one accessing the table at the time the connection is lost it will be destroyed. ... Solid Quality Mentors ...
    (microsoft.public.sqlserver.connect)
  • Re: ##temp table already exists problem
    ... Global temp tables are visible to all connections, ... multiple processes, then you can easily get errors like that. ... which was created by another connection. ... Prev by Date: ...
    (comp.databases.ms-sqlserver)
  • Re: Connection Timeout
    ... Andrew J. Kelly SQL MVP ... I have a PPC app which connects to an SQL server via RF. ... out of range the connection timeout is too long. ... I've had a look at the general sql client connection properties, ...
    (microsoft.public.sqlserver.clients)