How to get a list of all Temp tables:The insights of an SQL geek


The insights of an SQL geek: How to get a list of all Temp tables

Thursday, January 1, 2009

How to get a list of all Temp tables

Hello all.
One of my friends asked me today how he can get a list of all Temp tables.
Well the answer is very simple, that I have to share.
Just use this:


use tempdb
go
select *
from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = USER and
TABLE_CATALOG = 'tempdb'
go

Enjoy and don’t forget to leave comments.
Itay.

No comments:

Post a Comment