Saturday, September 14, 2013

To get a count of objects for all the databases on a Host -- Table_Count of rows

Table_Count of rows
--To get a count of objects for all the databases on a Host

sp_msforeachdb ‘select ”?” as DatabaseName, count(*) as CountObjects from ?.sys.objects’


  To get a count of rows from all the tables in a database
  sp_msforeachtable ‘select ”?”, Count(*) from ?’

No comments:

Post a Comment