Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sybase tempdb question ..

Status
Not open for further replies.

grega

Programmer
Feb 2, 2000
932
GB
Apologies for posting this here. I've also posted to the ASE board, but it's very quiet these days. Just hoping there's a Sybase person lurking here!

Is there any way that I, as user sa, can view a temp table in tempdb created by another user. The tablename is preceded by a # (persists for session only) and the users session is still open.

Sybase tells me the table is owned by dbo, so I've tried all of the following ... all tell me the table doesn't exist.
Code:
select * from tempdb.dbo.#usertable
select * from tempdb.guest.#usertable
select * from tempdb.<userid>.#usertable
Any thoughts much appreciated.

Greg.
 
If the similarities to SQL Server extend to global temp tables, then what you want is a global temporary table, rather than a local temporary table.
Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions.
Global temporary tables are automatically dropped when the session that created the table ends and all other tasks have stopped referencing them, or when they are explicitly dropped. The tablename is preceeded by ##.
Again, this is how SQL Server works - probably a good chance Sybase works this way too. Malcolm
 
Thanks Malcolm. You're right ... in answer to my own question, contents of a &quot;local&quot; temporary table cannot be seen, even by the admin user. It's not causing a major problem, but I just was curious. Sybase does seem to be a very close mirror of SQL Server though (or vice versa!)

Greg.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top