Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2009-04-16 : 07:18:00
|
I was wondering if there is a way of finding out which tables in a databases hold zero rows of data.That is other that running the SELECT Count(*) From [Table Name]Statement, I've though of happen a cursor to run through the tables but don't reall like that solution.Any ideas Guys |
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2009-04-16 : 07:43:33
|
select distinctsys.tables.name,sys.partitions.rowsfrom sys.partitions inner join sys.tables on sys.partitions.object_id = sys.tables.object_idWHERE rows = 0ORDER BY SYS.partitions.rows desc |
 |
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2009-04-16 : 08:22:25
|
Thanks for that excellent help |
 |
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2009-04-16 : 08:31:30
|
welcom! |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-16 : 08:39:42
|
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/02/different-ways-to-count-rows-from-a-table.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|