Script for getting the statistics of a table

  • Hi Everyone,

    I need a script to list all the user tables and its corresponding no.of rows inserted,deleted,updated individually.

    Can anyone help me out giving me a clue.

    select o.name,i.rowmodctr

    FROM SYSOBJECTS o

      JOIN SYSINDEXES i

         ON o.id = i.id

        and o.xtype = 'U'

        and o.name  = 'daily_master'

    The table name I have specified in this query has a column date_created which is defaulted to getdate(). Totally there are about 50,000 rows got inserted to the table. But the output of the query seems to be weird.

    Basically, I wanted to run a query to get the statistical information of a particular table.

    Thanks in advance.

    Thanks,

    Ganesh

     

     

     

  • My guess is you're probably referring to the multiple rows result set.

    If so, you want to limit the query by index id type.

    Try append this clause to the query

    and i.indid in (0,1)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply