Casper Posted November 10, 2011 Report Share Posted November 10, 2011 I didn't find anything with a quick Google search so I started digging around. Came up with this:select 'Table Name'=convert(char(25),t.TABLE_NAME), 'Record Count'=max(i.rows)from sysindexes i, INFORMATION_SCHEMA.TABLES twhere t.TABLE_NAME = object_name(i.id) and t.TABLE_TYPE = 'BASE TABLE' and t.TABLE_NAME like '%Product%' or t.TABLE_NAME = object_name(i.id) and t.TABLE_TYPE = 'BASE TABLE' and t.TABLE_NAME like '%Employee%' group by t.TABLE_NAMEIt finds all of the tables in the database that contain Employee or Product and lists the table names and the counts. Works on 2005 and 2008. Not sure it'd work in 2000. Probably not. I figured I'd share in case anyone else could use this. Obviously Employee and Product weren't actually what we were searching for. LOL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.