database - How to find list of tables having no records in SQL server -
how display list of tables having no record inserted in them , existing in sql server database.required show tables no record in them.
try this:
select t.name tablename, p.rows rowcounts sys.tables t inner join sys.partitions p on t.object_id = p.object_id t.name not 'dt%' , t.is_ms_shipped = 0 , p.rows = 0 group t.name, p.rows order t.name
the query goes sys.tables
, other catalog views find tables, indexes , partitions, find tables have row count of 0.
Comments
Post a Comment