Last one hour database status

  • How to check that how many raw are inserted, updated, deleted in last one hours for all the databases of Server ?

    Regards,

    Arjun

  • Do you have some sort of auditing enabled on the instance?

    Auditing = Auditing, Profiler Trace, XEvents, Triggers

  • @SQLSACT, no i don't set

  • Without some sort of auditing process in place - it's gonna be extremely difficult to get what you want.

    You could examine the transaction log with fn_dblog but transaction logs get truncated, unless they're not being taken care of.

  • like SQLSACT said, you need something in place already to get "by hour" counts.

    for example, this query gets the # of rows in each table. if you saved the results in a table, you could subtract the differences compared to each time you ran this process,and get your totals...so you could have something going forward, but nothing to report the past, since it was never captured.

    most likely, you really only want to report on three or four tables related to your processes, and not *all* tables.

    Select OBJECT_NAME(object_id) as TableName,SUM(rows) as NumRows,index_id

    From sys.partitions p

    Inner Join sys.sysobjects o

    on p.object_id = o.id

    Where index_id in (0,1)

    And o.type = 'U'

    Group By object_id,index_id

    Order By NumRows Desc

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 5 posts - 1 through 4 (of 4 total)

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