Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

temp table belongs only to @@SPID?

Posted on 2011-02-25
6
Medium Priority
?
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 41

Accepted Solution

by:
ralmada earned 2000 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 2000 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

715 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