Where do temporary tables get stored in a database? I want to drop a temporary table if it already exists. I can do this for securable tables by querying at information schema but I don't know where temporary tables are stored.
Asked
Active
Viewed 5.3k times
5 Answers
22
Temporary tables are stored in tempdb Database. There are various ways to check if a temp table exists outlined here: Check If Temporary Table Exists.

Giorgi
- 30,270
- 13
- 89
- 125
8
Temporary tables gets stored in tempdb database which is present in SystemDatabase or SystemDatabase -> tempdb -> Temporary Tables

Ankit Chaurasia
- 81
- 1
- 1
0
Here you can find all your temp tables (both local and global) which are stored and active using SSMS.

Nandha MV
- 469
- 4
- 14