473,507 Members | 12,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

##temp table already exists problem

Hello

I am using a temp table called ##temp in an SProc but often get the
message that the table already exists. Could this be because the SProc
is being run by more than 2 webpages at the same time?
Or is it because the sProc has an error and is not getting to the drop
table line?

I have tried adding a line to test if the object exists and to drop the
table before I create it. If I drop it will it affect another instance
of the sProc that is using the same table name?

If so is there a way around this?

Many thanks
Nigel

Jul 23 '05 #1
2 6302
Global temp tables are visible to all connections, so if you have
multiple processes, then you can easily get errors like that. And if
you drop the table explicitly, one connection could drop the table
which was created by another connection.

Is there some specific reason why you can't use a local temp table? Or
perhaps you can use a permanent table, with @@SPID as part of the key?
If you can explain some more about what you're trying to do, then
someone may be able to suggest an alternative solution.

Simon

Jul 23 '05 #2
Thanks Simon.
So If I use # instead of ## the table is connection based rather than
global. Id did sort of know that but you have made it clear. I will
change to # instead of ##.

The situation is that I have a website that runs an SProc to get the
content of a banner. This runs for most pages on the site.
nigel

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11843
by: Jonathan | last post by:
I am looking for a simple way to check if a database table exists. I keep getting advice to use "Try.. Catch" and other error handling methods, but I obviously don't want to have to display an...
2
2301
by: Savas Ates | last post by:
i have a stored below it uses create temp table and drop temp table... when more than one user request the same page it probably returns error.. how can i solve this problem ...
21
3177
by: Boris Popov | last post by:
Hello pgsql-general, I'm trying to implement a table with rows that are automatically deleted when the session that inserted them disconnects, sort of like our own alternative to...
1
3672
by: Lauren Quantrell | last post by:
I have read the newsgroups and see this is a common issue but I saw no resolution for it: I have an Access2K frotn end and SQL Server 2K backend. In access, I create a temp table using code in a...
1
2879
by: Robert McEuen | last post by:
Using Access 97 on WinXP I have data in a DB2 table that I'm trying to get into an identical table in my backend db. Based on volume of data and frequency of download, I'm trying to avoid...
2
4608
by: Timothy Perrigo | last post by:
I'm working on a plpgsql function that creates and populates a temporary table. I would like the function to first drop the temp table, if it already exists. I'm not sure how to accomplish this,...
4
4552
by: M Bourgon | last post by:
I have two SPs, call them Daily and Weekly. Weekly will always call Daily, but Daily can run on its own. I currently use a global temp table because certain things I do with it won't work with a...
6
3290
by: betbubble | last post by:
I need help on two questions: 1. Is temp table the only way to pass recordsets from a nested stored procedure to a calling stored procedure? Can we avoid temp tables in this case? 2. Are...
15
16141
by: OfficeDummy | last post by:
Hello all! I searched the Internet and this forum for a similar problem, but I found no help... Also, I'm a complete newbie to the fascinating world of programming, VBA and Access, so my question...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.