How do i count the number of rows in each table in my database?

  • Thread starter Thread starter BigG
  • Start date Start date
B

BigG

I need to display the row counts of all the 200+ linked tables in my database
in some kind of table/report/query. Does anyone know how to do this?
 
As far as I know, for linked tables you actually need to query each one.

You could try a query like

SELECT [Name] AS TableName, DCount("*",[Name]) AS RowCount
FROM MSysObjects
WHERE [Type] In (1,4,6)
AND Left([Name], 4) <> "MSys"

Note that it could be very slow to run though...
 
Doug - you are a legend! Thanks so much! This is the first time I have used
this forum and am sure wil not be the last. Once again a great tip which I
will be able to use over and over again!

Thanks again.
G

Douglas J. Steele said:
As far as I know, for linked tables you actually need to query each one.

You could try a query like

SELECT [Name] AS TableName, DCount("*",[Name]) AS RowCount
FROM MSysObjects
WHERE [Type] In (1,4,6)
AND Left([Name], 4) <> "MSys"

Note that it could be very slow to run though...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


BigG said:
I need to display the row counts of all the 200+ linked tables in my
database
in some kind of table/report/query. Does anyone know how to do this?
 
Back
Top