Return to Snippet

Revision: 13587
at April 28, 2009 14:18 by blackf0rk


Initial Code
select distinct convert(varchar(30),object_name(a.id)) [Table Name], a.rows
from sysindexes a inner join sysobjects b on a.id = b.id
inner join INFORMATION_SCHEMA.TABLES c on c.[TABLE_NAME]=convert(varchar(30),object_name(a.id))
where c.Table_catalog='DATABASE NAME'

Initial URL

                                

Initial Description
This will return a list of all the tables in a certain database along with their row count.

Initial Title
Return a table list with row count

Initial Tags
table, list

Initial Language
SQL