Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 TempTable

Author  Topic 

real_pearl
Posting Yak Master

106 Posts

Posted - 2004-06-17 : 05:04:02
Temp table exists in Tempdb. But is it possible to view its rows in Enterpise Manager?

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-06-17 : 06:23:34
No because it only exists for the session you have created it in...
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-06-17 : 07:46:20
... so do the query in EM too?

Can't think why you'd want to ... but:

EM, open NORTHWIND : Tables

Right Click CATEGORIES : Open Table Query

Do your SQL:

SELECT *
INTO #KRISTEN
FROM [dbo].[Categories]

"8 rows effected ... [OK]"

Find name of Temp Table (still in EM):

SELECT name
FROM tempdb.dbo.sysobjects
WHERE name LIKE '#kristen%'
AND type = 'U'

Cut&Paste result name into:

SELECT *
FROM tempdb.dbo.[#KRISTEN____... stuff deleted ...___00000000086F]

And there's the Edit Grid Table Thingie. Notice we are still in NORTHWIND in EM

Well weird, but!

Kristen
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-17 : 09:08:46
That will only work if you are using the same spid - and select * from #KRISTEN should work too.

The only thing you can do easily from a different spid is see (approx) how many rows there are in the table from sysindexes.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-17 : 12:17:31
Why use Enterprise Manager for this? Why not use Query Analyzer?

Tara
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-06-17 : 13:39:14
quote:
Originally posted by nr

... and select * from #KRISTEN should work too ....

I was trying to put him off!

Kristen
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-06-18 : 03:30:33
quote:
Originally posted by Kristen

quote:
Originally posted by nr

... and select * from #KRISTEN should work too ....

I was trying to put him off!

Kristen


I thought i'd already done that...
Go to Top of Page
   

- Advertisement -