To get a list of empty tables, we can use below tsql -
EXEC sp_MSforeachtable 'IF NOT EXISTS (SELECT 1 FROM ?) PRINT ''?'' '
And to get a list of tables having at least one row of data, we can use below tsql -
EXEC sp_MSforeachtable 'IF EXISTS (SELECT 1 FROM ?) PRINT ''?'' '
Venkatesh yeluri
source share