Friday, September 07, 2012

TOAD for SQL Server - hide empty tables

If you are using SQL server and TOAD and have a lot of empty tables that you do not want to show, you can use Object Explorer filter to add this code to prevent them from being shown:

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


Thanks TOAD forum for the help!

2 comments:

  1. Where on Object Explorer would you add this code?

    In the table filter?

    ReplyDelete
  2. When you filter in the Object Explorer when looking at tables, you should find the SQL tab, as far as I remember (Sorry, I do not have TOAD installed right now so this is from my memory). I hope that it helps.

    ReplyDelete