Toad World® Forums

Filtering tables in Object Explorer


Does anyone know how to filter tables in Object Explorer that have 0 rows? For example, out of 100 tables 40 of them are empty and I do not wish to see them in Object Explorer.


Hello, Bane!

You can use the code in ObjExp filter to hide empty tables:

ISNULL((SELECT SUM(spart.rows)
FROM sys.partitions spart
WHERE spart.object_id = obj.object_id AND
spart.index_id <> 0


In the Object Explorer, there's a filter icon. If you click on it, you can add the following WHERE clause which seems to work for me!

You can also save a Named filter at the top of this screen, then you can access the filter from the Object Explorer drop down menu any time you need it.