Solved

temp table belongs only to @@SPID?

Posted on 2011-02-25
6
302 Views
Last Modified: 2012-06-21
I created a temp table, but another user is not able to go to tempdb and see the table- how can I  help her to see the table?

thanks
0
Comment
Question by:anushahanna
  • 3
  • 3
6 Comments
 
LVL 41

Accepted Solution

by:
ralmada earned 500 total points
ID: 34980432
No, I don't think that's possible. I would suggest you create a regular table if you want multiple users to access it.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34980572
OK- so even though it is in tempdb, it will show up only in the original SPID - if you happen to close that window, then even the author can never reach it?
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 500 total points
ID: 34980803
Yes, that's right. One the session is closed, you cannot retrieve it.

Just to clarify, you have two types of temp tables. local temp tables, that are only accesible in the module it was created, and global temp table that are accessible only in the session that creates them. That means that no other sessions (for example another user logged in) can access it.

0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 6

Author Comment

by:anushahanna
ID: 34982654
you  mean #temp and ##temp, right? ## is global?
0
 
LVL 41

Expert Comment

by:ralmada
ID: 34982736
yes, that's right :)
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34982819
thanks as always, ralmada.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Some sers suddenly getting error popup msg 28 89
How to search for strings inside db views 4 28
optimize stored procedure 6 29
SSRS Enable Remote Errors 4 26
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question