Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

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')

0
brokeMyLegBiking
Asked:
brokeMyLegBiking
  • 3
1 Solution
 
SireesCommented:
exec sp_tables
0
 
SireesCommented:
Use Tempdb
exec sp_tables
0
 
SireesCommented:
To just get user tabels you can also do


select name, user_name(uid) from sysobjects where type='U'
0
 
Scott PletcherSenior DBACommented:
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'
0

Featured Post

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!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now