473,395 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Question about temporary table .

I have a stored procedure that creates a temporary table.
If two people (using the same account) execute the same stored
procedure at the same time, will they overwrite / access the temporary
table ?

Calista.
Jul 20 '05 #1
2 4533
Hi

Temporary tables are only visible to the current connection. See

http://msdn.microsoft.com/library/de...es_04_8jtx.asp

The name within the database itself is made unique by SQL Server
e.g.

create table #Test ( id int not null )
select name from tempdb..sysobjects where name like '%Test%'
INSERT INTO #Test ( id ) VALUES ( 1 )
select * from #Test

John

"Calista" <ca***********@hotmail.com> wrote in message
news:e1**************************@posting.google.c om...
I have a stored procedure that creates a temporary table.
If two people (using the same account) execute the same stored
procedure at the same time, will they overwrite / access the temporary
table ?

Calista.

Jul 20 '05 #2
To add to John's response, local temp tables (single '#') are uniquely
named by SQL Server. It is your application's responsibility to
uniquely name global temp tables ('##') if you need to prevent name
conflicts due to concurrency issues.

--
Hope this helps.

Dan Guzman
SQL Server MVP

-----------------------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index....partmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------

"Calista" <ca***********@hotmail.com> wrote in message
news:e1**************************@posting.google.c om...
I have a stored procedure that creates a temporary table.
If two people (using the same account) execute the same stored
procedure at the same time, will they overwrite / access the temporary
table ?

Calista.

Jul 20 '05 #3

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

Similar topics

4
by: Corrine | last post by:
Hi, I am creating a global temporary table that is session-specific. I insert a BLOB into this table, and then select the BLOB from this table into a ResultSet. The ResultSet sees this BLOB...
0
by: Peter Gorelczenko | last post by:
I'm running as normal user (not root or database owner). This user has c= reate=20 temporary table priv. show tables partial: GRANT CREATE TEMPORARY TABLES ON `foobar0`.* TO 'foo'@'localhost'...
4
by: gonzal | last post by:
Hi Dose any body know why a temporary table gets deleted after querying it the first time (using SELECT INTO)? When I run the code bellow I'm getting an error message when open the temp table...
3
by: Jonathan | last post by:
Hi all! For a match schedule I would like to find all possible combinations of teams playing home and away (without teams playing to themselves of course). I now the simple version works...
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
13
by: Elaine | last post by:
This has to do with self-joins and includes a running balance problem. Is it possible to do this using SQL alone? Amortization schedule -------------------------- Givens: beginning balance,...
6
by: Sam Durai | last post by:
A join query is running against my db which is logically partitioned. The join involves a partitioned table (has around 300 Million rows) which is spread across 7 partitions and a small...
1
by: jlepack | last post by:
I have a table that tracks the entry of certain datapoints. tbl_data_entry: data_type_id (ties eventually to a department, formatting, etc.) employee_id date value Along with this I have a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.