How to find how many updates done in a table ?

  • Hi All,

    I have a problem... I would like to know if the data has been updated / inserted into the table or database in the past day or before day. I dont have any triggers or any other.

    Is there any way to find how many updates on a table are done yesterday ?

    Thanks,

    CH&HU.

  • If you have not auditing triggers or tracefiles, the only option to get all the detailed info would be using some third-party tools to read out your transaction log files and backups.

    If you're only interested about the number of changed records you might be able to find out by comparing the current records with a backup from yesterday.

    [font="Verdana"]Markus Bohse[/font]

  • No,we cannot find it.

    If you have a datetime column in that table and if it has getdate() as default you may track this.

    Or go through "Database Snapshots"

  • Thanks much for the reply...

    Is there any other way to find the udpates or trasactions done on a publisher in replication, as i need to monitor and check if how much data or tables has been updated from the subscriber end...

    Please help....

    Thanks,

    CH&HU.

  • It really depends on your system, but you could look at the cache to determine if updates have been run. It will only work if the queries are still in cache, assuming they're not marked as trivial execution plans, which don't go into cache at all. Checking sys.dm_exec_requests in the Books Online will get you started.

    Otherwise, you need to set up auditing triggers, go to SQL 2008 Enterprise and enable change data capture, or keep a server-side trace running to capture all the queries as they come by.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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