Question

So I know it's possible to do a select and show all of the empty tables with no records in a db, but I'm wondering if this is possible to do in the filter settings somehow, so only populated tables will show when I expand the tables folder, so I can eliminate otherwise useless tables.

Thanks in advance

Était-ce utile?

La solution

No, but there's an easy option to identify tables with no rows in SSMS; in Object Explorer, right click on the database, and select Reports. Click on Disk Usage By Table, and a report will pop up showing you all of your tables with the # of records, and disk space required. Sort by # of records, and there's your punch list.

If you need to massage the list, you can right click on the report, and export it to Excel, where you could craft your drop table statements.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top