Page 1 of 1

Temporary Tables can not be found..

Posted: Tue 12 May 2009 08:47
by josh
Hi!
I am using Delphi 7 and I have a MSQuery component which creates a temporary table. This component's query is parameterized. If I try to access the temporary table after creating it the table can not be found. If I don't use parameters and manually create the sql query and put it in the component using sql.add I can access the temporary table with a problem. Is there an option I have to set? What am i doing wrong?

Josh

Posted: Wed 13 May 2009 12:52
by Challenger
Please specify the version of server you are using.

Posted: Wed 13 May 2009 19:31
by josh
ms sql server 2008 enterprise edition

Posted: Mon 18 May 2009 07:08
by tonisanta
Hi, could it be you are closing the connection after creating the temp-table and reopening it before accessing the table again? I had a similar problem when creating a temp-table from one connection and accessing it from another: when closing the connection (SPID) which created the table, the temporary table was destroyed still if there was other cocnections accessing it. Hope this helps.
best regards
Toni

Posted: Mon 18 May 2009 08:48
by josh
i'm definitely not closing the connection. i made a example application where i basically try what i explained above.
the working example:
i connect. i create the the temp table. i query the temp table.

the example that doesn't work:
i connect. i create the the temp table. i set the query's paramters. i query the temp table. i reveive an error message saying the table does not exist


josh

Posted: Mon 18 May 2009 11:10
by Challenger
We could not reproduce the problem. Please send us a small sample to reproduce it.