Where To Find Temp Tables In SQL Server

Recently, I was working on a project where I was searching for a critical temp table. In this article, I will walk you through all the simple approaches to find temp tables in SQL Server.

Where To Find Temp Tables In SQL Server

Let us discuss all the approaches individually.

Approach-1: Using SQL Server Management Studio (SSMS)

To find temp tables in SQL Server, follow the below steps.

1. Launch SQL Server Management Studio (SSMS) and connect to your SQL server database instance.

2. Expand the Databases folder, Expand the System Databases folder, and then expand the tempdb folder; now expand the Tables folder, and then finally expand the Temporary Tables folder, as shown in the screenshot below. Now, you can see the available temp table.

Where To Find Temp Tables In SQL Server

Approach-2: Using SQL Query

We can query sys.objects to find the SQL server temp table details.

USE tempdb;
SELECT * FROM sys.objects 
WHERE name LIKE '#%'

After executing the above query, I got the list of available temp table details, as shown in the screenshot below.

where are temp tables stored in sql server

Approach-3: Using sys.tables

We can also query the sys.tables to view temp tables in SQL Server.

SELECT *
FROM   tempdb.sys.tables

After executing the above query, I can see the temp tables in my SQL server, as shown in the screenshot below.

where are the temp tables stored in sql server

Video Tutorial

Conclusion

Now, you have the answer to the question where can I find temp tables in SQL server. You can either check it on the SystemDatabase -> tempdb -> Temporary Tables or you can query the sys.objects and tempdb.sys.tables as explained in this article.

You may also like following the articles below.

Top 200 SQL Server Interview Questions and Answers

Free PDF On Top 200 SQL Server Interview Questions And Answers

Download A 40 pages PDF And Learn Now.