s

list of temp tables in sql server edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 23 September 2020 | 2214

There are a couple of ways you can find the list of temporary tables in SQL Server. I have checked both the queries in the Microsoft azure SQL server and both of them work fine and returned the list of temporary tables in the SQL database.

Solution

--for sql-server 2005 and later versions
select * from tempdb.sys.objects

--for sql-server 2000 and later versions
select * from tempdb..sysobjects