Solved

temp table belongs only to @@SPID?

Posted on 2011-02-25
6
300 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Author Comment

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

Expert Comment

by:ralmada
Comment Utility
yes, that's right :)
0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
thanks as always, ralmada.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now