Link to home
Start Free TrialLog in
Avatar of brokeMyLegBiking
brokeMyLegBiking

asked on

list tables in tempdb

How can I list the tables in the tempdb?

This doesn't work:

   select * from tempdb.systables

and this doesn't work:

   object_id('#ztemp_fundingDynamic')

Avatar of Sirees
Sirees

exec sp_tables
Use Tempdb
exec sp_tables
ASKER CERTIFIED SOLUTION
Avatar of Sirees
Sirees

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scott Pletcher
Do you want to list *all* tables or just your own?

If you want to list all, you can do this:

SELECT name
FROM tempdb.dbo.sysobjects WITH (NOLOCK)
WHERE xtype = 'U'