I recently needed to get a quick row count from each table in a large SQL database, and I came across this post that shows two ways to do it. I'm pasting the SQL queries below; read the original post for more information.sp_msforeachtable "Print '?' select count(*) from ?"select convert(varchar(30),object_name(id)) [Table Name], rows from sysindexes
where object_name(id) not like 'sys%' and indid = 1
order by object_name(id)
Friday, July 06, 2007
Retrieving SQL Table Row Counts
Posted by
jwyse
at
1:47 PM
1 comments
Labels: Development, SQL, Tips
Subscribe to:
Posts (Atom)