Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qry to get table name and size in records

Status
Not open for further replies.

cricketer1

Technical User
Mar 15, 2001
76
US
How do I write a query to get table names and there sizes (# of records) in a database. What sys tables and columns should I query.

Thanks
cricketer1
 
Hi cricketer1

This should help you:

select o.name as "Table Name",i.rowcnt as "Row Count"
from sysobjects o, sysindexes i
where i.id = o.id
and indid in(0,1)
and xtype = 'U'
order by o.name

Hope this helps

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top