Home Forums SQL Server 2008 SQL Server 2008 - General how to find name of a table which has maximum number of transactions for a large database RE: how to find name of a table which has maximum number of transactions for a large database

  • First off run this

    select 'insert into #temp select count(*),'''+name+''' from '+object_schema_name(object_id)+'.'+name+';' from sys.objects where type = 'u'

    Then copy the output from the above and paste it into the comment line below

    create table #temp (records int, tablename sysname)

    --PUT OUTPUT OF THE TOP LINE IN HERE

    select * from #temp order by 1 desc