list of temp tables in sql server Edit

Murugan Andezuthu Dharmaratnam | 23 September 2020 | 644

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