ANOTHER TEMP TABLE ? 
Author Message
 ANOTHER TEMP TABLE ?

The answer to my previous post suggested that a use a
#TEMP table because a ##TEMP table is global.  With my
limited understanding the ##TEMP table will remain
throughout a single connection.  The #TEMP will only allow
1 connection to that table before it dies.  Since i am
using this temp table for preview data then i will need to
access this table frequently.  I tried switching to the
#TEMP and it does not work as the ##TEMP did.  I need this
table to be dynamically created so that 2 instances of my
application can run at the same time.  Any suggestions??


Mon, 15 Aug 2005 22:31:27 GMT
 ANOTHER TEMP TABLE ?

Quote:
> limited understanding the ##TEMP table will remain
> throughout a single connection.

That is incorrect.  A ##temp table is accessible from all connections.
Essentially, it is really no different from creating a permanent table in
tempdb.

I'm not following how your table is 'dying'?  Are you running a stored
procedure, which creates a table, and then accessing it multiple times?  Why
do you need a separate table for each user?  I would consider using a single
permanent table with a column identifying the user, then you don't have to
worry about collisions... however I really don't know enough about your app
to make recommendations, other than the fact that neither #temp nor ##temp
tables seem like they will meet your needs.

--
Aaron Bertrand, SQL Server MVP
http://www.aspfaq.com/

Please reply in the newsgroups, but if you absolutely
must reply via e-mail, please take out the TRASH.



Mon, 15 Aug 2005 23:01:10 GMT
 ANOTHER TEMP TABLE ?
You need to name the temp table in a way so the names doesn't collide. Best is to avoid dynamic
SQL in the first place...

--
Tibor Karaszi, SQL Server MVP
For help on TSQL, give us something we can execute in Query Analyzer


Quote:
> The answer to my previous post suggested that a use a
> #TEMP table because a ##TEMP table is global.  With my
> limited understanding the ##TEMP table will remain
> throughout a single connection.  The #TEMP will only allow
> 1 connection to that table before it dies.  Since i am
> using this temp table for preview data then i will need to
> access this table frequently.  I tried switching to the
> #TEMP and it does not work as the ##TEMP did.  I need this
> table to be dynamically created so that 2 instances of my
> application can run at the same time.  Any suggestions??



Mon, 15 Aug 2005 22:59:48 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Temp table vs Global Temp table

2. temp table problem with global temp option

3. returning temp result of temp table to ADO/ASP

4. temp table in temp dbspace

5. Massive Updates: Temp Or Not Temp Tables?

6. ALTER TABLE on temp tables, table variables

7. Error renaming table file to a temp table table caused ingres to crash

8. temp table or static table?

9. Switching from Temp Tables to Table Variables

10. Temp Table Vs Table Variable

11. Temporary tables VS 'temp-tables'

12. performance question - table or temp table


 
Powered by phpBB® Forum Software