Home All Groups Group Topic Archive Search About

sort of simple query i think....

Author
22 Sep 2005 8:48 PM
Justin Rich
I need to get the record count for all tables in a DB and get the
description of that table (which is stored in another table)

i need something like this.

for each (exec sp_tables @table_type="'TABLE'")
select count(*) as cnt from TABLE


my sql isnt that great.. but what i need to do is get a list of tables, get
the record count of each table, find the table name in a table called F9860
that has the "description" of that table and insert that in to a table..

I cant use the F9860 to get a list of table names because it has table names
from other databases...

i hope thats clear enough.

Thanks
Justin

Author
22 Sep 2005 9:21 PM
Alejandro Mesa
How do I get a list of SQL Server tables and their row counts?
http://www.aspfaq.com/show.asp?id=2428


AMB

Show quote
"Justin Rich" wrote:

> I need to get the record count for all tables in a DB and get the
> description of that table (which is stored in another table)
>
> i need something like this.
>
> for each (exec sp_tables @table_type="'TABLE'")
> select count(*) as cnt from TABLE
>
>
> my sql isnt that great.. but what i need to do is get a list of tables, get
> the record count of each table, find the table name in a table called F9860
> that has the "description" of that table and insert that in to a table..
>
> I cant use the F9860 to get a list of table names because it has table names
> from other databases...
>
> i hope thats clear enough.
>
> Thanks
> Justin
>
>
>

AddThis Social Bookmark Button