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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Finding Tables With no data

Author  Topic 

victord
Yak Posting Veteran

64 Posts

Posted - 2002-04-05 : 04:27:19
Dear All,
We have got a database with thousands of tables in it, of which we use only a couple of hundreds. Now it has gotten to a stage where we have to know which tables haven't got data in them. The question now is, is there a script or tool that i can use to solve this issue.
Please help

Thanks in Adnace.
Victord

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2002-04-05 : 05:52:57
Something like this should do the trick.

SELECT so.name tablename
FROM sysindexes si
INNER JOIN sysobjects so ON si.id = so.id
WHERE si.indid in (0,1)
AND si.rowcnt = 0
AND so.type = 'U'
AND so.name <> 'dtproperties'

 


Edited by - Arnold Fribble on 04/05/2002 05:59:58
Go to Top of Page

victord
Yak Posting Veteran

64 Posts

Posted - 2002-04-05 : 06:40:05
Thanks a lot Arnold,
That Sorted my problem.
Victord

Go to Top of Page

Jay99

468 Posts

Posted - 2002-04-05 : 09:31:53
Check out this Bad-Mutha.

Jay
<O>
Go to Top of Page
   

- Advertisement -