Simhadri
Simhadri

Reputation: 931

Sql Query to find Temp tables in DB

Please suggest me a query to find temp database tables.

Upvotes: 10

Views: 19893

Answers (2)

Sachin Shanbhag
Sachin Shanbhag

Reputation: 55489

All temp tables created are stored in the tempdb available on sql server. So run this query in tempdb, you will find available temp tables on the server -

select * from sysobjects where "xtype" = 'u'

Hope this will help you

Upvotes: 7

Martin Smith
Martin Smith

Reputation: 453287

select name from tempdb.sys.tables

Upvotes: 13

Related Questions